From 22f19f6fdbbbc9bafe43f8f98a9cc503ef1b29f6 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 17 Dec 2010 15:23:33 +0000 Subject: [PATCH] Fix a segmentation fault that occurs when "Confirm on Stop" is enabled, the close button of the window is clicked, and the user answers No to the resulting confirmation. Fixes issue 3716. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6601 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Frame.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index fb144d17fc..c18459df54 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -543,27 +543,28 @@ void CFrame::OnActive(wxActivateEvent& event) void CFrame::OnClose(wxCloseEvent& event) { + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + DoStop(); + if (Core::GetState() != Core::CORE_UNINITIALIZED) + return; + UpdateGUI(); + } + //Stop Dolphin from saving the minimized Xpos and Ypos if(main_frame->IsIconized()) main_frame->Iconize(false); // Don't forget the skip or the window won't be destroyed event.Skip(); + // Save GUI settings if (g_pCodeWindow) SaveIniPerspectives(); - // Close the log window now so that its settings are saved - if (!g_pCodeWindow) - m_LogWindow->Close(); + else m_LogWindow->Close(); // Uninit m_Mgr->UnInit(); - - if (Core::GetState() != Core::CORE_UNINITIALIZED) - { - DoStop(); - UpdateGUI(); - } } // Post events