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:
@ -1349,14 +1349,12 @@ void CFrame::OnConfigControllers(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
ControllerConfigDiag config_dlg(this);
|
||||
config_dlg.ShowModal();
|
||||
config_dlg.Destroy();
|
||||
}
|
||||
|
||||
void CFrame::OnConfigMenuCommands(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
HotkeyConfigDialog *m_HotkeyDialog = new HotkeyConfigDialog(this);
|
||||
m_HotkeyDialog->ShowModal();
|
||||
m_HotkeyDialog->Destroy();
|
||||
HotkeyConfigDialog m_HotkeyDialog(this);
|
||||
m_HotkeyDialog.ShowModal();
|
||||
|
||||
// Update the GUI in case menu accelerators were changed
|
||||
UpdateGUI();
|
||||
@ -1384,9 +1382,8 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
|
||||
#endif
|
||||
}
|
||||
|
||||
InputConfigDialog m_ConfigFrame(this, *hotkey_plugin, _("Dolphin Hotkeys"), 0);
|
||||
InputConfigDialog m_ConfigFrame(this, *hotkey_plugin, _("Dolphin Hotkeys"));
|
||||
m_ConfigFrame.ShowModal();
|
||||
m_ConfigFrame.Destroy();
|
||||
|
||||
// if game isn't running
|
||||
if (!was_init)
|
||||
|
Reference in New Issue
Block a user