summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 1c7c0642a..10650b9e6 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -86,6 +86,7 @@ import com.android.gallery3d.filtershow.ui.FilterIconButton;
import com.android.gallery3d.filtershow.ui.FramedTextButton;
import com.android.gallery3d.filtershow.ui.Spline;
import com.android.gallery3d.util.GalleryUtils;
+import com.android.photos.data.GalleryBitmapPool;
import java.io.File;
import java.io.IOException;
@@ -141,6 +142,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ clearGalleryBitmapPool();
+
setupMasterImage();
setDefaultValues();
fillEditors();
@@ -512,6 +515,17 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
+ private void clearGalleryBitmapPool() {
+ (new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... params) {
+ // Free memory held in Gallery's Bitmap pool. May be O(n) for n bitmaps.
+ GalleryBitmapPool.getInstance().clear();
+ return null;
+ }
+ }).execute();
+ }
+
private void fillButtonIcons() {
Bitmap bmap = mImageLoader.getOriginalBitmapSmall();
if (bmap != null && bmap.getWidth() > 0 && bmap.getHeight() > 0) {