From 3be00e102c7e02e1f4507f529801cf5fe3ae489c Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 24 Jan 2010 03:50:40 +0000 Subject: [PATCH] Fix wiimote config dialog. In linux if the dialog is opened and then the program is closed without running a game the program hangs and has to be killed because the dialog was never destroyed. In both windows and linux if the dialog is opened and then a game is run, the program hangs or segfaults (for the respective os's) when the game is stopped. This will also need to be done with the pad plugin as the same issue is there. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4940 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_Wiimote/Src/ConfigBasicDlg.cpp | 2 -- Source/Plugins/Plugin_Wiimote/Src/main.cpp | 29 +++---------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp index 8056e777a7..3c9da08c61 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp @@ -76,8 +76,6 @@ WiimoteBasicConfigDialog::WiimoteBasicConfigDialog(wxWindow *parent, wxWindowID void WiimoteBasicConfigDialog::OnClose(wxCloseEvent& event) { - // necessary as this dialog is only showed/hided - UpdateGUI(); g_FrameOpen = false; EndModal(wxID_CLOSE); } diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.cpp b/Source/Plugins/Plugin_Wiimote/Src/main.cpp index b2e7752b13..51496ff234 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/main.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/main.cpp @@ -183,23 +183,10 @@ void DllConfig(HWND _hParent) #if defined(HAVE_WX) && HAVE_WX - if (!m_BasicConfigFrame) - m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent)); - else if (!m_BasicConfigFrame->GetParent()->IsShown()) - m_BasicConfigFrame->Close(true); - // Update the GUI (because it was not updated when it had been already open before...) - m_BasicConfigFrame->UpdateGUI(); - // Only allow one open at a time - if (!m_BasicConfigFrame->IsShown()) - { - g_FrameOpen = true; - m_BasicConfigFrame->ShowModal(); - } - else - { - g_FrameOpen = false; - m_BasicConfigFrame->Hide(); - } + m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent)); + g_FrameOpen = true; + m_BasicConfigFrame->ShowModal(); + m_BasicConfigFrame->Destroy(); #endif } @@ -261,14 +248,6 @@ void Shutdown(void) // Reset the game ID in all cases g_ISOId = 0; - // We will only shutdown when both a game and the m_ConfigFrame is closed - if (g_FrameOpen) - { - #if defined(HAVE_WX) && HAVE_WX - if(m_BasicConfigFrame) m_BasicConfigFrame->UpdateGUI(); - #endif - } - #if HAVE_WIIUSE if (g_RealWiiMoteInitialized) WiiMoteReal::Shutdown(); #endif