Little cleanup for CrashMonitor

This commit is contained in:
RadWolfie 2018-06-11 00:11:34 -05:00
parent d0fd6d08d1
commit 8e2543af4f
1 changed files with 5 additions and 4 deletions

View File

@ -2330,28 +2330,29 @@ void WndMain::CrashMonitor()
WaitForSingleObject(hProcess, INFINITE); WaitForSingleObject(hProcess, INFINITE);
dwProcessID_ExitCode = 0; dwProcessID_ExitCode = 0;
GetExitCodeProcess(hProcess, &dwProcessID_ExitCode); GetExitCodeProcess(hProcess, &dwProcessID_ExitCode);
CloseHandle(hProcess);
g_EmuShared->GetMultiXbeFlag(&bQuickReboot); g_EmuShared->GetMultiXbeFlag(&bQuickReboot);
if (!bQuickReboot) { if (!bQuickReboot) {
if (dwProcessID_ExitCode == EXIT_SUCCESS) {// StopEmulation if (dwProcessID_ExitCode == EXIT_SUCCESS) {// StopEmulation
CloseHandle(hProcess);
return; return;
} else { // that's a crash
CloseHandle(hProcess);
} }
// Or else, it's a crash
} }
else { else {
// multi-xbe // multi-xbe
// destroy this thread and start a new one // destroy this thread and start a new one
CloseHandle(hProcess);
bQuickReboot = false; bQuickReboot = false;
g_EmuShared->SetMultiXbeFlag(&bQuickReboot); g_EmuShared->SetMultiXbeFlag(&bQuickReboot);
return; return;
} }
} }
} }
// Crash clean up.
KillTimer(m_hwnd, TIMERID_FPS); KillTimer(m_hwnd, TIMERID_FPS);
KillTimer(m_hwnd, TIMERID_LED); KillTimer(m_hwnd, TIMERID_LED);
DrawLedBitmap(m_hwnd, true); DrawLedBitmap(m_hwnd, true);