diff options
author | John Reck <jreck@google.com> | 2013-03-07 11:00:29 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2013-03-07 11:00:29 -0800 |
commit | 2ff8d80018c27abdd475a7610ab3d684c4b33acb (patch) | |
tree | 3ffaa1d6dd7fdfb5070d14820b55781a9405b8e6 /src/com/android/photos/shims | |
parent | 17362f811fa92ff0d9f92b3c733f08704de2f135 (diff) | |
download | android_packages_apps_Gallery2-2ff8d80018c27abdd475a7610ab3d684c4b33acb.tar.gz android_packages_apps_Gallery2-2ff8d80018c27abdd475a7610ab3d684c4b33acb.tar.bz2 android_packages_apps_Gallery2-2ff8d80018c27abdd475a7610ab3d684c4b33acb.zip |
recycle bitmaps
Change-Id: I3afda4f009fda07b4e2858cb65dee4444f8484e5
Diffstat (limited to 'src/com/android/photos/shims')
-rw-r--r-- | src/com/android/photos/shims/BitmapJobDrawable.java | 6 |
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(); |