DolphinWX: Get rid of unnecessary Destroy calls

Removes the requirement for stack allocated InputConfigDialogs to call Destroy. This shouldn't be necessary for wxDialog derivatives.
This also fixes a leak that would occur every time an InputConfigDialog is opened and closed. wxWindow subclasses (this includes wxDialog) only destroy child windows and sizers (including things in the sizers). So every wxTimer allocation would have resulted in a leak.
This commit is contained in:
Lioncash
2015-02-11 09:07:16 -05:00
parent d9988ee9b5
commit 9a6b6a99e8
5 changed files with 10 additions and 28 deletions

View File

@ -412,17 +412,14 @@ void ControllerConfigDiag::ConfigEmulatedWiimote(wxCommandEvent& ev)
Wiimote::Initialize(reinterpret_cast<void*>(GetHandle()));
#endif
}
InputConfigDialog m_ConfigFrame(this, *wiimote_plugin, _("Dolphin Emulated Wiimote Configuration"), m_wiimote_index_from_conf_bt_id[ev.GetId()]);
m_ConfigFrame.ShowModal();
m_ConfigFrame.Destroy();
if (!was_init) // if game isn't running
{
Wiimote::Shutdown();
}
//InputConfigDialog* const m_emu_config_diag = new InputConfigDialog(this, *Wiimote::GetConfig(), _trans("Dolphin Emulated Wiimote Configuration"), m_wiimote_index_from_conf_bt_id[ev.GetId()]);
//m_emu_config_diag->ShowModal();
//m_emu_config_diag->Destroy();
}
void ControllerConfigDiag::RefreshRealWiimotes(wxCommandEvent&)
@ -569,13 +566,11 @@ void ControllerConfigDiag::OnGameCubeConfigButton(wxCommandEvent& event)
{
InputConfigDialog m_ConfigFrame(this, *key_plugin, _("GameCube Controller Configuration"), port_num);
m_ConfigFrame.ShowModal();
m_ConfigFrame.Destroy();
}
else
{
InputConfigDialog m_ConfigFrame(this, *pad_plugin, _("GameCube Controller Configuration"), port_num);
m_ConfigFrame.ShowModal();
m_ConfigFrame.Destroy();
}
// if game isn't running