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:
+2
-13
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user