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:
@ -1079,13 +1079,7 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputConfig& config
|
||||
Center();
|
||||
|
||||
// live preview update timer
|
||||
m_update_timer = new wxTimer(this);
|
||||
m_update_timer.SetOwner(this);
|
||||
Bind(wxEVT_TIMER, &InputConfigDialog::UpdateBitmaps, this);
|
||||
m_update_timer->Start(PREVIEW_UPDATE_TIME, wxTIMER_CONTINUOUS);
|
||||
}
|
||||
|
||||
bool InputConfigDialog::Destroy()
|
||||
{
|
||||
m_update_timer->Stop();
|
||||
return true;
|
||||
m_update_timer.Start(PREVIEW_UPDATE_TIME, wxTIMER_CONTINUOUS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user