diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 10e693079e..56dfd82a21 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -23,14 +23,6 @@ extern android::Framework * g_framework; -namespace yg -{ -namespace gl -{ - extern bool g_hasContext; -} -} - namespace android { @@ -42,7 +34,6 @@ Framework & GetFramework() Framework::Framework() { - yg::gl::g_hasContext = false; // @TODO refactor storage m_work.Storage().ReInitCountries(false); } diff --git a/android/jni/com/mapswithme/maps/VideoTimer.cpp b/android/jni/com/mapswithme/maps/VideoTimer.cpp index 4658989ded..53df5416c7 100644 --- a/android/jni/com/mapswithme/maps/VideoTimer.cpp +++ b/android/jni/com/mapswithme/maps/VideoTimer.cpp @@ -11,7 +11,7 @@ namespace yg { namespace gl { - extern bool g_hasContext; + extern bool g_doDeleteOnDestroy; } } @@ -22,7 +22,7 @@ Java_com_mapswithme_maps_SmartGLSurfaceView_nativeBind(JNIEnv * env, jobject thi { if (isBound) { - yg::gl::g_hasContext = true; + yg::gl::g_doDeleteOnDestroy = true; g_requestRenderMethodID = jni::GetJavaMethodID(env, thiz, "requestRender", "()V"); ASSERT(g_requestRenderMethodID, ("Can't find method void com/mapswithme/maps/SmartGLSurfaceView.requestRender()")); @@ -30,7 +30,7 @@ Java_com_mapswithme_maps_SmartGLSurfaceView_nativeBind(JNIEnv * env, jobject thi } else { - yg::gl::g_hasContext = false; + yg::gl::g_doDeleteOnDestroy = false; jobject refToDelete = g_smartGLSurfaceView; g_smartGLSurfaceView = 0; env->DeleteGlobalRef(refToDelete); diff --git a/android/src/com/mapswithme/maps/SmartGLSurfaceView.java b/android/src/com/mapswithme/maps/SmartGLSurfaceView.java index c8f3019daa..61af2d8ca1 100644 --- a/android/src/com/mapswithme/maps/SmartGLSurfaceView.java +++ b/android/src/com/mapswithme/maps/SmartGLSurfaceView.java @@ -55,7 +55,6 @@ public class SmartGLSurfaceView extends GLSurfaceView public void surfaceCreated (SurfaceHolder holder) { Log.d(TAG, "surfaceCreated"); - nativeBind(true); m_renderer.m_isBaseSurfaceReady = false; super.surfaceCreated(holder); } @@ -67,6 +66,7 @@ public class SmartGLSurfaceView extends GLSurfaceView m_renderer.m_isBaseSurfaceReady = true; super.surfaceChanged(holder, format, w, h); queueEvent(m_tryToLoadResourcesIfReady); + nativeBind(true); } @Override