mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 00:59:44 +00: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:
parent
4fd980e6d4
commit
4cc19ac926
4 changed files with 13 additions and 23 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue