1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 02:46:38 +02:00

Merge usefulness of Timer and CallBack classes into Timer, and fix it to really work

This commit is contained in:
Adam
2013-03-30 23:38:40 -05:00
parent 111d6a9178
commit 7e7556f064
14 changed files with 71 additions and 61 deletions
+2 -13
View File
@@ -57,9 +57,9 @@ Module::~Module()
{
/* Detach all event hooks for this module */
ModuleManager::DetachAll(this);
/* Clear any active callbacks this module has */
ModuleManager::ClearCallBacks(this);
IdentifyRequest::ModuleUnload(this);
/* Clear any active timers this module has */
TimerManager::DeleteTimersFor(this);
std::list<Module *>::iterator it = std::find(ModuleManager::Modules.begin(), ModuleManager::Modules.end(), this);
if (it != ModuleManager::Modules.end())
@@ -111,14 +111,3 @@ int ModuleVersion::GetPatch() const
return this->version_patch;
}
CallBack::CallBack(Module *mod, long time_from_now, time_t now, bool repeating) : Timer(time_from_now, now, repeating), m(mod)
{
}
CallBack::~CallBack()
{
std::list<CallBack *>::iterator it = std::find(m->callbacks.begin(), m->callbacks.end(), this);
if (it != m->callbacks.end())
m->callbacks.erase(it);
}