From 1f0850e9baeb851175a265ec6cc3327bb13a5a44 Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Tue, 26 Feb 2019 20:01:31 +0300 Subject: [PATCH] [vulkan] Switching to night style fixed. --- android/src/com/mapswithme/maps/MapFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/android/src/com/mapswithme/maps/MapFragment.java b/android/src/com/mapswithme/maps/MapFragment.java index dcb37a8dbc..181ce4f099 100644 --- a/android/src/com/mapswithme/maps/MapFragment.java +++ b/android/src/com/mapswithme/maps/MapFragment.java @@ -64,6 +64,7 @@ public class MapFragment extends BaseMwmFragment private int mWidth; private boolean mRequireResize; private boolean mContextCreated; + private boolean mSurfaceAttached; private boolean mLaunchByDeepLink; private static boolean sWasCopyrightDisplayed; @Nullable @@ -184,6 +185,7 @@ public class MapFragment extends BaseMwmFragment return; } mContextCreated = true; + mSurfaceAttached = true; mRequireResize = true; return; } @@ -217,6 +219,7 @@ public class MapFragment extends BaseMwmFragment } mContextCreated = true; + mSurfaceAttached = true; onRenderingInitialized(); } @@ -252,12 +255,14 @@ public class MapFragment extends BaseMwmFragment void destroyContext() { LOGGER.d(TAG, "destroyContext, mContextCreated = " + mContextCreated + - ", isAdded = " + isAdded(), new Throwable()); - if (!mContextCreated || !isAdded()) + ", mSurfaceAttached = " + mSurfaceAttached + ", isAdded = " + isAdded(), + new Throwable()); + if (!mContextCreated || !mSurfaceAttached || !isAdded()) return; nativeDetachSurface(!getActivity().isChangingConfigurations()); mContextCreated = !nativeDestroyContextOnSurfaceDetach(); + mSurfaceAttached = false; } @Override