diff options
Diffstat (limited to 'src/libui_sdl/main.cpp')
-rw-r--r-- | src/libui_sdl/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index f27c7ed..241d9b7 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -320,10 +320,11 @@ void Run() uiMenuItemSetChecked(MenuItem_Pause, 0); } -void Stop() +void Stop(bool internal) { EmuRunning = 2; - while (EmuStatus != 2); + if (!internal) // if shutting down from the UI thread, wait till the emu thread has stopped + while (EmuStatus != 2); RunningSomething = false; uiMenuItemDisable(MenuItem_Pause); @@ -449,7 +450,7 @@ void OnStop(uiMenuItem* item, uiWindow* window, void* blarg) { if (!RunningSomething) return; - Stop(); + Stop(false); } void OnOpenEmuSettings(uiMenuItem* item, uiWindow* window, void* blarg) |