summaryrefslogtreecommitdiff
path: root/src/timer.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-01-30 21:44:51 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-01-30 21:44:51 +0100
commit5ac1ffce1168c4e3409e6667ff30285bfbc82bde (patch)
tree09b4ab975d5bfd221aa1341d722524b97764fe4f /src/timer.cpp
parent407f10664a5f8ead87967ca52fd6fcb87d09189a (diff)
Allow Timers to delete themselves in Tick()
Diffstat (limited to 'src/timer.cpp')
-rw-r--r--src/timer.cpp5
1 files changed, 3 insertions, 2 deletions
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);