Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't ever ever let CFrame::DoStop() run twice at the same time.
  • Loading branch information
RachelBryk committed Sep 3, 2013
1 parent e110f10 commit e9ffba7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -1017,6 +1017,9 @@ void CFrame::DoStop()
if (confirmStop)
return;

// don't let this function run again until it finishes, or is aborted.
confirmStop = true;

m_bGameLoading = false;
if (Core::GetState() != Core::CORE_UNINITIALIZED ||
m_RenderParent != NULL)
Expand All @@ -1030,7 +1033,6 @@ void CFrame::DoStop()
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
{
Core::EState state = Core::GetState();
confirmStop = true;
Core::SetState(Core::CORE_PAUSE);
wxMessageDialog m_StopDlg(
this,
Expand All @@ -1040,10 +1042,10 @@ void CFrame::DoStop()
wxDefaultPosition);

int Ret = m_StopDlg.ShowModal();
confirmStop = false;
if (Ret != wxID_YES)
{
Core::SetState(state);
confirmStop = false;
return;
}
}
Expand All @@ -1058,6 +1060,7 @@ void CFrame::DoStop()
wxBeginBusyCursor();
BootManager::Stop();
wxEndBusyCursor();
confirmStop = false;

#if defined(HAVE_X11) && HAVE_X11
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bDisableScreenSaver)
Expand Down

0 comments on commit e9ffba7

Please sign in to comment.