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:
Lioncash
2015-02-28 20:25:50 -05:00
parent 4fd980e6d4
commit 4cc19ac926
4 changed files with 13 additions and 23 deletions

View File

@ -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();