summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2009-09-30 16:39:15 -0700
committerMarco Nelissen <marcone@google.com>2009-10-01 08:16:02 -0700
commit9b150b74573ce506abd00c692fb42f46980441a3 (patch)
tree1dc213e6af3959c213340404367410f3757974a2
parent87b94b13ea8ad708d079ddfafe4801c12c38e57a (diff)
downloadframeworks_base-9b150b74573ce506abd00c692fb42f46980441a3.zip
frameworks_base-9b150b74573ce506abd00c692fb42f46980441a3.tar.gz
frameworks_base-9b150b74573ce506abd00c692fb42f46980441a3.tar.bz2
Close the cursor before assigning a new one to the same variable.
-rw-r--r--core/java/android/provider/MediaStore.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 6d66296..062080d 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -345,6 +345,7 @@ public final class MediaStore {
baseUri.buildUpon().appendPath(String.valueOf(origId))
.toString().replaceFirst("thumbnails", "media"));
if (filePath == null) {
+ if (c != null) c.close();
c = cr.query(uri, PROJECTION, null, null, null);
if (c == null || !c.moveToFirst()) {
return null;