LibCore: Ignore timer events after stop() has been called

This commit is contained in:
Ali Mohammad Pur 2024-03-25 13:34:09 +01:00 committed by Andreas Kling
parent 003ac1bd51
commit 61148e9bc2
Notes: sideshowbarker 2024-07-17 08:36:27 +09:00

View File

@ -41,6 +41,8 @@ void EventReceiver::event(Core::Event& event)
{ {
switch (event.type()) { switch (event.type()) {
case Core::Event::Timer: case Core::Event::Timer:
if (!m_timer_id)
break; // Too late, the timer was already stopped.
return timer_event(static_cast<TimerEvent&>(event)); return timer_event(static_cast<TimerEvent&>(event));
case Core::Event::ChildAdded: case Core::Event::ChildAdded:
case Core::Event::ChildRemoved: case Core::Event::ChildRemoved: