diff options
| -rwxr-xr-x | src/com/android/gallery3d/app/PhotoPage.java | 3 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 1 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/filtershow/filters/ImageFilter.java | 7 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/com/android/gallery3d/ui/EdgeView.java | 4 | ||||
| -rwxr-xr-x | src/com/android/gallery3d/ui/PhotoView.java | 5 |
5 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index e8dd13fac..cdd5742fd 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -1660,7 +1660,8 @@ public abstract class PhotoPage extends ActivityState implements } mActivity.getGLRoot().setOrientationSource(null); if (mBottomControls != null) mBottomControls.cleanup(); - + mPhotoView.destroy(); + mPhotoView = null; // Remove all pending messages. mHandler.removeCallbacksAndMessages(null); super.onDestroy(); diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 452f4014c..8ada5af9b 100755 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -291,6 +291,7 @@ DialogInterface.OnDismissListener, PopupMenu.OnDismissListener{ * see this happen. */ mBoundService = null; + ImageFilter.resetStatics(); MasterImage.setMaster(null); } }; diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java index 4918bee86..bf3d02c12 100755 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java @@ -22,6 +22,7 @@ import android.graphics.Matrix; import android.renderscript.Allocation; import android.widget.Toast; +import com.android.gallery3d.app.GalleryAppImpl; import com.android.gallery3d.filtershow.imageshow.GeometryMathUtils; import com.android.gallery3d.filtershow.imageshow.MasterImage; import com.android.gallery3d.filtershow.pipeline.FilterEnvironment; @@ -57,7 +58,7 @@ public abstract class ImageFilter implements Cloneable { @Override public void run() { if (sActivity != null && (!msg.equals(lastMsg) || sToast == null)) { - sToast = Toast.makeText(sActivity.getApplicationContext(), msg, duration); + sToast = Toast.makeText(GalleryAppImpl.getContext(), msg, duration); lastMsg = msg; } if (sToast != null) { @@ -69,9 +70,7 @@ public abstract class ImageFilter implements Cloneable { } void showToast(int resID, int duration) { - if (sActivity != null) { - showToast(sActivity.getResources().getString(resID), duration); - } + showToast(GalleryAppImpl.getContext().getString(resID), duration); } public void freeResources() {} diff --git a/src/com/android/gallery3d/ui/EdgeView.java b/src/com/android/gallery3d/ui/EdgeView.java index 051de18fa..dc648b457 100644..100755 --- a/src/com/android/gallery3d/ui/EdgeView.java +++ b/src/com/android/gallery3d/ui/EdgeView.java @@ -49,6 +49,10 @@ public class EdgeView extends GLView { } } + public void release () { + mEffect = null; + } + @Override protected void onLayout( boolean changeSize, int left, int top, int right, int bottom) { diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 7ee799c03..68ce55f91 100755 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -1384,6 +1384,11 @@ public class PhotoView extends GLView { hideUndoBar(); } + public void destroy() { + mEdgeView.release(); + mEdgeView = null; + } + public void resume() { mTileView.prepareTextures(); mPositionController.skipToFinalPosition(); |
