diff --git a/Core/Core.cpp b/Core/Core.cpp index cf4ceb0fc4..2a44f38b78 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -139,7 +139,9 @@ static inline void UpdateRunLoop() { NativeUpdate(input_state); EndInputState(&input_state); } - NativeRender(); + if (globalUIState != UISTATE_EXIT) { + NativeRender(); + } } void Core_RunLoop() { diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index e121a7e118..7d203b1f25 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -55,7 +55,7 @@ void EmuThread_Stop() // Already stopped? { lock_guard guard(emuThreadLock); - if (emuThread == NULL) + if (emuThread == NULL || emuThreadReady == THREAD_END) return; } diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index dd0d443153..039d0f4ff5 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -104,6 +104,7 @@ bool WindowsHost::InitGL(std::string *error_message) void WindowsHost::ShutdownGL() { GL_Shutdown(); + PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0); } void WindowsHost::SetWindowTitle(const char *message)