Timed out objects must be disarmed

This commit is contained in:
simon.kagstrom 2010-01-30 18:43:33 +00:00
parent d3e4552174
commit 94c53ceb22
2 changed files with 10 additions and 0 deletions

View File

@ -1,11 +1,19 @@
#include "sysdeps.h" #include "sysdeps.h"
#include "Prefs.h" #include "Prefs.h"
#include "gui/gui.hh"
#include "timer.hh" #include "timer.hh"
#include "utils.hh" #include "utils.hh"
#define MS_TO_TICKS(x) ((x) / ThePrefs.MsPerFrame) #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() TimerController::TimerController()
{ {
this->n_handlers = 0; this->n_handlers = 0;

View File

@ -29,6 +29,8 @@ public:
this->timer_id = -1; this->timer_id = -1;
} }
~TimeoutHandler();
void tick() void tick()
{ {
this->timeout--; this->timeout--;