Windows: Fix shutdown order (stop the main thread before the window gets destroyed)

This commit is contained in:
Henrik Rydgård 2022-12-11 10:02:21 +01:00
parent e48a1599d4
commit a8985d8dda
2 changed files with 3 additions and 3 deletions

View File

@ -968,6 +968,7 @@ namespace MainWindow
break;
case WM_CLOSE:
MainThread_Stop();
InputDevice::StopPolling();
WindowsRawInput::Shutdown();
return DefWindowProc(hWnd,message,wParam,lParam);
@ -976,8 +977,9 @@ namespace MainWindow
KillTimer(hWnd, TIMER_CURSORUPDATE);
KillTimer(hWnd, TIMER_CURSORMOVEUPDATE);
KillTimer(hWnd, TIMER_WHEELRELEASE);
// Main window is gone, this tells the message loop to exit.
PostQuitMessage(0);
break;
return 0;
case WM_USER + 1:
NotifyDebuggerMapLoaded();

View File

@ -776,8 +776,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
}
}
MainThread_Stop();
VFSShutdown();
MainWindow::DestroyDebugWindows();