Minor change in Timer::stop() to avoid calling removeMessagesForTimer() when it's not necessary

This commit is contained in:
David Capello 2018-12-12 13:26:35 -03:00
parent 92330adc30
commit 3b810701ce

View File

@ -49,13 +49,15 @@ void Timer::start()
void Timer::stop()
{
m_running = false;
if (m_running) {
m_running = false;
// Remove messages of this timer in the queue. The expected behavior
// is that when we stop a timer, we'll not receive more messages
// about it (even if there are enqueued messages waiting in the
// message queue).
Manager::getDefault()->removeMessagesForTimer(this);
// Remove messages of this timer in the queue. The expected behavior
// is that when we stop a timer, we'll not receive more messages
// about it (even if there are enqueued messages waiting in the
// message queue).
Manager::getDefault()->removeMessagesForTimer(this);
}
}
void Timer::tick()