From 94c53ceb22b52f607221963ed2281b5aaff5c1e1 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 30 Jan 2010 18:43:33 +0000 Subject: [PATCH] Timed out objects must be disarmed --- Src/timer.cpp | 8 ++++++++ Src/timer.hh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Src/timer.cpp b/Src/timer.cpp index 39a541d..a2c30ed 100644 --- a/Src/timer.cpp +++ b/Src/timer.cpp @@ -1,11 +1,19 @@ #include "sysdeps.h" #include "Prefs.h" +#include "gui/gui.hh" #include "timer.hh" #include "utils.hh" #define MS_TO_TICKS(x) ((x) / ThePrefs.MsPerFrame) +TimeoutHandler::~TimeoutHandler() +{ + /* If we haven't timed out yet, disarm us */ + Gui::gui->timerController->disarm(this); +} + + TimerController::TimerController() { this->n_handlers = 0; diff --git a/Src/timer.hh b/Src/timer.hh index 57801b8..86a262a 100644 --- a/Src/timer.hh +++ b/Src/timer.hh @@ -29,6 +29,8 @@ public: this->timer_id = -1; } + ~TimeoutHandler(); + void tick() { this->timeout--;