diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index a2596d1368..297a31c661 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -248,9 +248,9 @@ MainUI::~MainUI() if (emuThreadState != (int)EmuThreadState::DISABLED) { ILOG("EmuThreadStop"); EmuThreadStop(); - while (emuThreadState != (int)EmuThreadState::STOPPED) { + while (graphicsContext->ThreadFrame()) { // Need to keep eating frames to allow the EmuThread to exit correctly. - graphicsContext->ThreadFrame(); + continue; } EmuThreadJoin(); } diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index bdc6c6d973..9cd5af04a9 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -896,9 +896,9 @@ int main(int argc, char *argv[]) { if (useEmuThread) { EmuThreadStop(); - while (emuThreadState != (int)EmuThreadState::STOPPED) { + while (graphicsContext->ThreadFrame()) { // Need to keep eating frames to allow the EmuThread to exit correctly. - graphicsContext->ThreadFrame(); + continue; } EmuThreadJoin(); } diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index b211783f6a..27a34fcc7b 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -244,9 +244,9 @@ void MainThreadFunc() { if (useEmuThread) { EmuThreadStop(); - while (emuThreadState != (int)EmuThreadState::STOPPED) { + while (graphicsContext->ThreadFrame()) { // Need to keep eating frames to allow the EmuThread to exit correctly. - graphicsContext->ThreadFrame(); + continue; } EmuThreadJoin(); } diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 2bf386e315..747629bde6 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -511,8 +511,8 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_pause(JNIEnv *, jclass) { extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) { if (useCPUThread && graphicsContext) { EmuThreadStop(); - while (emuThreadState != (int)EmuThreadState::STOPPED) { - graphicsContext->ThreadFrame(); + while (graphicsContext->ThreadFrame()) { + continue; } EmuThreadJoin(); } @@ -546,8 +546,8 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, graphicsContext->ThreadEnd(); if (useCPUThread) { EmuThreadStop(); - while (emuThreadState != (int)EmuThreadState::STOPPED) { - graphicsContext->ThreadFrame(); + while (graphicsContext->ThreadFrame()) { + continue; } EmuThreadJoin(); } else {