summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-30 19:43:48 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-30 19:43:48 -0400
commit701507459e0d49421bd4a493f2df4511ab4b6841 (patch)
tree78677d68acb7d8e624a3a0d3ee9ae0cbe3c3a6c8
parentafb66cac1dbe9a98ca51b031f5238d72e0f86f82 (diff)
parent00fa4098b4aa953f6e5d68b63638506c45b38e20 (diff)
downloadpackages_apps_LegacyCamera-701507459e0d49421bd4a493f2df4511ab4b6841.zip
packages_apps_LegacyCamera-701507459e0d49421bd4a493f2df4511ab4b6841.tar.gz
packages_apps_LegacyCamera-701507459e0d49421bd4a493f2df4511ab4b6841.tar.bz2
Merge change I00fa4098 into eclair
* changes: When discarding an empty image list, we need to close it first, otherwise we end up leaking Cursors
-rw-r--r--src/com/android/camera/ImageManager.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java
index 679d96c..f2c931d 100644
--- a/src/com/android/camera/ImageManager.java
+++ b/src/com/android/camera/ImageManager.java
@@ -359,7 +359,10 @@ public class ImageManager {
Iterator<BaseImageList> iter = l.iterator();
while (iter.hasNext()) {
BaseImageList sublist = iter.next();
- if (sublist.isEmpty()) iter.remove();
+ if (sublist.isEmpty()) {
+ sublist.close();
+ iter.remove();
+ }
}
if (l.size() == 1) {