forked from organicmaps/organicmaps
[android] jni crash fix
This commit is contained in:
parent
4aa4a1e8a5
commit
95a05dcf90
1 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,7 @@ namespace
|
|||
return g_framework->NativeFramework();
|
||||
}
|
||||
|
||||
jobject g_mapObjectListener;
|
||||
jobject g_mapObjectListener = nullptr;
|
||||
} // namespace
|
||||
|
||||
namespace android
|
||||
|
@ -715,6 +715,9 @@ Java_com_mapswithme_maps_Framework_nativeSetMapObjectListener(JNIEnv * env, jcla
|
|||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_Framework_nativeRemoveMapObjectListener(JNIEnv * env, jclass)
|
||||
{
|
||||
if (g_mapObjectListener == nullptr)
|
||||
return;
|
||||
|
||||
frm()->SetMapSelectionListeners({}, {});
|
||||
env->DeleteGlobalRef(g_mapObjectListener);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue