DoStop() shouldn't unpause in debug mode

This commit is contained in:
Sepalani 2017-04-24 17:19:35 +01:00
parent d1dc9d5a0c
commit 4a55398069
1 changed files with 8 additions and 5 deletions

View File

@ -802,15 +802,16 @@ void CFrame::DoStop()
std::lock_guard<std::recursive_mutex> lk(keystate_lock); std::lock_guard<std::recursive_mutex> lk(keystate_lock);
wxMutexGuiEnter(); wxMutexGuiEnter();
#endif #endif
// Pause the state during confirmation and restore it afterwards
Core::State state = Core::GetState();
// Ask for confirmation in case the user accidentally clicked Stop / Escape // Ask for confirmation in case the user accidentally clicked Stop / Escape
if (SConfig::GetInstance().bConfirmStop) if (SConfig::GetInstance().bConfirmStop)
{ {
// Exit fullscreen to ensure it does not cover the stop dialog. // Exit fullscreen to ensure it does not cover the stop dialog.
DoFullscreen(false); DoFullscreen(false);
// Pause the state during confirmation and restore it afterwards
Core::State state = Core::GetState();
// Do not pause if netplay is running as CPU thread might be blocked // Do not pause if netplay is running as CPU thread might be blocked
// waiting on inputs // waiting on inputs
bool should_pause = !NetPlayDialog::GetNetPlayClient(); bool should_pause = !NetPlayDialog::GetNetPlayClient();
@ -849,6 +850,7 @@ void CFrame::DoStop()
g_pCodeWindow->GetPanel<CBreakPointWindow>()->NotifyUpdate(); g_pCodeWindow->GetPanel<CBreakPointWindow>()->NotifyUpdate();
g_symbolDB.Clear(); g_symbolDB.Clear();
Host_NotifyMapLoaded(); Host_NotifyMapLoaded();
Core::SetState(state);
} }
// TODO: Show the author/description dialog here // TODO: Show the author/description dialog here
@ -877,8 +879,9 @@ bool CFrame::TriggerSTMPowerEvent()
return false; return false;
Core::DisplayMessage("Shutting down", 30000); Core::DisplayMessage("Shutting down", 30000);
// Unpause because gracefully shutting down needs the game to actually request a shutdown // Unpause because gracefully shutting down needs the game to actually request a shutdown.
if (Core::GetState() == Core::State::Paused) // Do not unpause in debug mode to allow debugging until the complete shutdown.
if (Core::GetState() == Core::State::Paused && !UseDebugger)
DoPause(); DoPause();
ProcessorInterface::PowerButton_Tap(); ProcessorInterface::PowerButton_Tap();
m_confirmStop = false; m_confirmStop = false;