From 5ac1ffce1168c4e3409e6667ff30285bfbc82bde Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 30 Jan 2014 21:44:51 +0100 Subject: Allow Timers to delete themselves in Tick() --- src/timer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/timer.cpp') diff --git a/src/timer.cpp b/src/timer.cpp index f541c7eb1..b897056e6 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -47,8 +47,9 @@ void TimerManager::TickTimers(time_t TIME) Timers.erase(i++); if (!t->Tick(TIME)) - delete t; - else if (t->GetRepeat()) + continue; + + if (t->GetRepeat()) { t->SetTrigger(TIME + t->GetInterval()); AddTimer(t); -- cgit v1.3.1-10-gc9f91