diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 720603a3..ec66a338 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -83,7 +83,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 274 + versionCode 275 versionName "1.6.0" } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index f9b62734..0b9e21bd 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -500,6 +500,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen @Override protected void onDestroy() { + PhotoViewer.getInstance().destroyPhotoViewer(); super.onDestroy(); onFinish(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index d7211fb6..becadcd9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -1697,6 +1697,22 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } } + public void destroyPhotoViewer() { + if (parentActivity == null || windowView == null) { + return; + } + try { + WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE); + if (windowView.getParent() != null) { + wm.removeViewImmediate(windowView); + } + windowView = null; + } catch (Exception e) { + FileLog.e("tmessages", e); + } + Instance = null; + } + private void onPhotoClosed(PlaceProviderObject object) { disableShowCheck = true; currentMessageObject = null;