summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2013-03-07 11:00:29 -0800
committerJohn Reck <jreck@google.com>2013-03-07 11:00:29 -0800
commit9603a0c884208a0dc9ef906043387a1758a97656 (patch)
tree8ba596014bf217d04c53030bc5b0cb2f557d5374 /src/com
parent5e46468ff8bce4c2912b9f5fb64df68f24f281cc (diff)
downloadandroid_packages_apps_Snap-9603a0c884208a0dc9ef906043387a1758a97656.tar.gz
android_packages_apps_Snap-9603a0c884208a0dc9ef906043387a1758a97656.tar.bz2
android_packages_apps_Snap-9603a0c884208a0dc9ef906043387a1758a97656.zip
recycle bitmaps
Change-Id: I3afda4f009fda07b4e2858cb65dee4444f8484e5
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/photos/shims/BitmapJobDrawable.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/photos/shims/BitmapJobDrawable.java b/src/com/android/photos/shims/BitmapJobDrawable.java
index 6623b914f..299becb07 100644
--- a/src/com/android/photos/shims/BitmapJobDrawable.java
+++ b/src/com/android/photos/shims/BitmapJobDrawable.java
@@ -14,6 +14,7 @@ import com.android.gallery3d.ui.BitmapLoader;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
import com.android.gallery3d.util.ThreadPool;
+import com.android.photos.data.GalleryBitmapPool;
import com.android.photos.drawables.AutoThumbnailDrawable;
@@ -33,7 +34,10 @@ public class BitmapJobDrawable extends Drawable implements Runnable {
mLoader.cancelLoad();
}
mItem = item;
- mBitmap = null;
+ if (mBitmap != null) {
+ GalleryBitmapPool.getInstance().put(mBitmap);
+ mBitmap = null;
+ }
// TODO: Figure out why ThumbnailLoader doesn't like to be re-used
mLoader = new ThumbnailLoader(this);
mLoader.startLoad();