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--;