mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user