diff options
author | Adam <Adam@anope.org> | 2010-07-31 21:37:45 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-31 21:37:45 -0400 |
commit | c770c47e18121e93bcdd06b1ab5f161440ffcfe2 (patch) | |
tree | 8e80d54507ab705e2dc51278c533c6000c8af1da /src/module.cpp | |
parent | 9d0d44d738705a457ce08599ba50c97033a43c71 (diff) |
Don't dynamically allocate commands in modules anymore, instead made them members of modules. This means the commands are automatically destructed when the module is unloaded. Cleans up some old ugly code.
Diffstat (limited to 'src/module.cpp')
-rw-r--r-- | src/module.cpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/module.cpp b/src/module.cpp index 97cf717de..aa46a6f63 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -40,81 +40,6 @@ Module::~Module() /* Clear any active callbacks this module has */ ModuleManager::ClearCallBacks(this); - /** - * ok, im going to walk every hash looking for commands we own, now, not exactly elegant or efficiant :) - **/ - if (HostServ) - { - for (CommandMap::iterator it = HostServ->Commands.begin(), it_end = HostServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(HostServ, c); - } - } - - if (BotServ) - { - for (CommandMap::iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(BotServ, c); - } - } - - if (MemoServ) - { - for (CommandMap::iterator it = MemoServ->Commands.begin(), it_end = MemoServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(MemoServ, c); - } - } - - if (NickServ) - { - for (CommandMap::iterator it = NickServ->Commands.begin(), it_end = NickServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(NickServ, c); - } - } - - if (ChanServ) - { - for (CommandMap::iterator it = ChanServ->Commands.begin(), it_end = ChanServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(ChanServ, c); - } - } - - if (OperServ) - { - for (CommandMap::iterator it = OperServ->Commands.begin(), it_end = OperServ->Commands.end(); it != it_end; ) - { - Command *c = it->second; - ++it; - - if (c->module == this) - this->DelCommand(OperServ, c); - } - } - std::list<Module *>::iterator it = std::find(Modules.begin(), Modules.end(), this); if (it != Modules.end()) Modules.erase(it); |