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
This commit is contained in:
Glenn Rice 2010-01-24 03:50:40 +00:00
parent ed8742dd4d
commit 3be00e102c
2 changed files with 4 additions and 27 deletions

View File

@ -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);
}

View File

@ -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