mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
DolphinWX: Clean up some wxTimer code
Technically fixes a memory leak (which wouldn't matter because the timer is only created once and destroyed on shutdown). Also starting and stopping the timer does not cause leaks.
This commit is contained in:
@ -508,15 +508,13 @@ CFrame::CFrame(wxFrame* parent,
|
||||
// check if game is running
|
||||
m_bHotkeysInit = InitControllers();
|
||||
|
||||
m_poll_hotkey_timer = new wxTimer(this);
|
||||
m_poll_hotkey_timer.SetOwner(this);
|
||||
Bind(wxEVT_TIMER, &CFrame::PollHotkeys, this);
|
||||
m_poll_hotkey_timer->Start(1000 / 60, wxTIMER_CONTINUOUS);
|
||||
m_poll_hotkey_timer.Start(1000 / 60, wxTIMER_CONTINUOUS);
|
||||
}
|
||||
// Destructor
|
||||
CFrame::~CFrame()
|
||||
{
|
||||
m_poll_hotkey_timer->Stop();
|
||||
|
||||
if (m_bHotkeysInit)
|
||||
{
|
||||
Wiimote::Shutdown();
|
||||
|
Reference in New Issue
Block a user