From d906462deea61e8e9285a39385e886908c1f1527 Mon Sep 17 00:00:00 2001 From: Aestek Date: Mon, 25 Jul 2016 00:43:09 +0200 Subject: [PATCH] Do not pause emulation when confirming stop when using NetPlay Pausing emulation requires to access the CPU thread, which might be blocked waiting for inputs by netplay. Accessing it in this state would cause the whole GUI to hang for set timeout (10s). --- Source/Core/DolphinWX/FrameTools.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 0ea5685a17..b3689e9ab5 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1132,10 +1132,17 @@ void CFrame::DoStop() // Pause the state during confirmation and restore it afterwards Core::EState state = Core::GetState(); + // Do not pause if netplay is running as CPU thread might be blocked + // waiting on inputs + bool should_pause = !NetPlayDialog::GetNetPlayClient(); + // If exclusive fullscreen is not enabled then we can pause the emulation // before we've exited fullscreen. If not then we need to exit fullscreen first. - if (!RendererIsFullscreen() || !g_Config.ExclusiveFullscreenEnabled() || - SConfig::GetInstance().bRenderToMain) + should_pause = + should_pause && (!RendererIsFullscreen() || !g_Config.ExclusiveFullscreenEnabled() || + SConfig::GetInstance().bRenderToMain); + + if (should_pause) { Core::SetState(Core::CORE_PAUSE); } @@ -1149,7 +1156,9 @@ void CFrame::DoStop() HotkeyManagerEmu::Enable(true); if (Ret != wxID_YES) { - Core::SetState(state); + if (should_pause) + Core::SetState(state); + m_confirmStop = false; return; }