summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/BitmapScreenNail.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/ui/BitmapScreenNail.java')
-rw-r--r--src/com/android/gallery3d/ui/BitmapScreenNail.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java
index 3481aa18e..064e1af0e 100644
--- a/src/com/android/gallery3d/ui/BitmapScreenNail.java
+++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java
@@ -20,6 +20,8 @@ import android.graphics.Bitmap;
import android.graphics.RectF;
import android.util.Log;
+import com.android.gallery3d.data.MediaItem;
+
// This is a ScreenNail wraps a Bitmap. It also includes the rotation
// information. The getWidth() and getHeight() methods return the width/height
// before rotation.
@@ -28,7 +30,7 @@ public class BitmapScreenNail implements ScreenNail {
private final int mWidth;
private final int mHeight;
private final int mRotation;
- private final Bitmap mBitmap;
+ private Bitmap mBitmap;
private BitmapTexture mTexture;
public BitmapScreenNail(Bitmap bitmap, int rotation) {
@@ -60,11 +62,15 @@ public class BitmapScreenNail implements ScreenNail {
}
@Override
- public void pauseDraw() {
+ public void recycle() {
if (mTexture != null) {
mTexture.recycle();
mTexture = null;
}
+ if (mBitmap != null) {
+ MediaItem.getThumbPool().recycle(mBitmap);
+ mBitmap = null;
+ }
}
@Override