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

Added a classbase for the major classes, makes dynamic_reference invalidation really work.

This also cleans up a bit of the code in the modestacker.
This commit is contained in:
Adam
2010-08-22 00:34:02 -04:00
parent 8a4c6ae618
commit ada65a3baf
12 changed files with 144 additions and 215 deletions
+4 -9
View File
@@ -382,18 +382,13 @@ Version Module::GetVersion() const
return Version(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
}
std::list<dynamic_reference_base *> dyn_references;
dynamic_reference_base::dynamic_reference_base()
Service::Service(Module *o, const Anope::string &n) : owner(o), name(n)
{
dyn_references.push_back(this);
ModuleManager::RegisterService(this);
}
dynamic_reference_base::~dynamic_reference_base()
Service::~Service()
{
std::list<dynamic_reference_base *>::iterator it = std::find(dyn_references.begin(), dyn_references.end(), this);
if (it != dyn_references.end())
dyn_references.erase(it);
ModuleManager::UnregisterService(this);
}