OSDN Git Service

Fixing memory leak in WallpaperCropActivity
authorSunny Goyal <sunnygoyal@google.com>
Tue, 22 Jul 2014 16:39:01 +0000 (09:39 -0700)
committerSunny Goyal <sunnygoyal@google.com>
Tue, 22 Jul 2014 16:39:01 +0000 (09:39 -0700)
issue 15516788

Change-Id: I6feb4cb72052bc7f19e9c30957bff7dcccd5bc9d

WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java

index 6c58da0..8652d85 100644 (file)
@@ -133,6 +133,14 @@ public class WallpaperCropActivity extends Activity {
         setCropViewTileSource(bitmapSource, true, false, onLoad);
     }
 
+    @Override
+    protected void onDestroy() {
+        if (mCropView != null) {
+            mCropView.destroy();
+        }
+        super.onDestroy();
+    }
+
     public void setCropViewTileSource(
             final BitmapRegionTileSource.BitmapSource bitmapSource, final boolean touchEnabled,
             final boolean moveToLeft, final Runnable postExecute) {