Don't use partial-restart unless debugger is present.

Works around #9666 for most practical purposes.
This commit is contained in:
Henrik Rydgard 2017-05-21 17:24:40 +02:00
parent 6e66f443e6
commit a1e3be445a
6 changed files with 47 additions and 17 deletions

View file

@ -242,7 +242,12 @@ void System_SendMessage(const char *command, const char *parameter) {
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
}
} else if (!strcmp(command, "graphics_restart")) {
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
if (IsDebuggerPresent()) {
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
} else {
g_Config.bRestartRequired = true;
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
}
} else if (!strcmp(command, "setclipboardtext")) {
if (OpenClipboard(MainWindow::GetDisplayHWND())) {
std::wstring data = ConvertUTF8ToWString(parameter);
@ -575,6 +580,10 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
LogManager::Shutdown();
if (g_Config.bRestartRequired) {
W32Util::ExitAndRestart();
}
net::Shutdown();
CoUninitialize();