From b30d5dccbe46c4bf9977a1437a826d082abebee0 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Fri, 20 Jun 2014 03:03:00 +0200 Subject: Frame: OnClose now handles asynchronous behaviour of DoStop(). --- Source/Core/DolphinWX/Frame.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Frame.cpp') diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 1807c5e53b..38b8ae7df0 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -352,7 +352,7 @@ CFrame::CFrame(wxFrame* parent, , m_LogWindow(nullptr), m_LogConfigWindow(nullptr) , m_FifoPlayerDlg(nullptr), UseDebugger(_UseDebugger) , m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) - , m_bGameLoading(false) + , m_bGameLoading(false), m_bClosing(false) { for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) bFloatWindow[i] = false; @@ -536,15 +536,18 @@ void CFrame::OnActive(wxActivateEvent& event) void CFrame::OnClose(wxCloseEvent& event) { + m_bClosing = true; + + // Before closing the window we need to shut down the emulation core. + // We'll try to close this window again once that is done. if (Core::GetState() != Core::CORE_UNINITIALIZED) { DoStop(); - if (Core::GetState() != Core::CORE_UNINITIALIZED) - return; - UpdateGUI(); + event.Veto(); + return; } - //Stop Dolphin from saving the minimized Xpos and Ypos + // Stop Dolphin from saving the minimized Xpos and Ypos if (main_frame->IsIconized()) main_frame->Iconize(false); -- cgit v1.2.3