summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/event_manager.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/event_manager.cc b/src/event_manager.cc
index 221a6d0d..11fb5c44 100644
--- a/src/event_manager.cc
+++ b/src/event_manager.cc
@@ -133,9 +133,10 @@ void EventManager::handle_next_events(EventMode mode, sigset_t* sigmask)
}
TimePoint now = Clock::now();
- for (auto& timer : m_timers)
+ auto timers = m_timers; // copy timers in case m_timers gets mutated
+ for (auto& timer : timers)
{
- if (timer->next_date() <= now)
+ if (contains(m_timers, timer) and timer->next_date() <= now)
timer->run(mode);
}
}