diff options
Diffstat (limited to 'src/timer.cpp')
-rw-r--r-- | src/timer.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/timer.cpp b/src/timer.cpp index 9157c1521..bc08ae1d0 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -39,6 +39,28 @@ void TimerManager::TickTimers(time_t TIME) } } +void TimerManager::DelTimer(InspTimer* T) +{ + timerlist::iterator found = Timers.find(T->GetTimer()); + + if (found != Timers.end()) + { + timergroup* x = found->second; + for (timergroup::iterator y = x->begin(); y != x->end(); y++) + { + InspTimer* n = *y; + if (n == T) + { + DELETE(n); + x->erase(y); + if (!x->size()) + Timers.erase(found); + return; + } + } + } +} + /* * Because some muppets may do odd things, and their ircd may lock up due * to crappy 3rd party modules, or they may change their system time a bit, |