From c007dd1852896efe1671ade96fa50080a030a51b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 4 Nov 2019 17:15:13 +0100 Subject: Android: Replace emulation rotation crash workaround with proper fix The workaround was added in 0446a58. The underlying problem is that we must not destroy the surface while the video backend is initializing, otherwise the video backend may reference nullptr. I've also cleaned up the logic for when to destroy the surface. Note that the comment in EmulationFragment.java about only being able to destroy the surface when emulation is running is not true anymore (due to de632fc, it seems like). --- Source/Android/jni/MainAndroid.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index e1b19314c3..66d7b0a1bb 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -197,6 +197,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulati jobject obj); JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv* env, jobject obj); +JNIEXPORT void JNICALL +Java_org_dolphinemu_dolphinemu_NativeLibrary_WaitUntilDoneBooting(JNIEnv* env, jobject obj); JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunning(JNIEnv* env, jobject obj); JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent( @@ -283,6 +285,12 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulatio s_update_main_frame_event.Set(); // Kick the waiting event } +JNIEXPORT void JNICALL +Java_org_dolphinemu_dolphinemu_NativeLibrary_WaitUntilDoneBooting(JNIEnv* env, jobject obj) +{ + Core::WaitUntilDoneBooting(); +} + JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunning(JNIEnv* env, jobject obj) { -- cgit v1.2.3