diff options
author | Adam <Adam@anope.org> | 2010-12-25 02:30:39 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-25 02:30:39 -0500 |
commit | 80721d1873e770eddd4c232d42d9ba920e6e644a (patch) | |
tree | ddfc0f526c9ca5581ff0d45cc9b46c9e07945a2b | |
parent | aa9e33cf74cbbb4572465a15cc9919511c297216 (diff) |
Forward port part of 821995bf604b5c6e18e6c0c93a31e149565160c8
-rw-r--r-- | src/bots.cpp | 8 | ||||
-rw-r--r-- | src/modules.cpp | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 87a646923..07ea91b3a 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -72,6 +72,14 @@ BotInfo::~BotInfo() ci->bi = NULL; } + for (CommandMap::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it) + { + Command *c = it->second; + + if (c->module) + c->module->DelCommand(this, c); + } + BotListByNick.erase(this->nick); if (!this->uid.empty()) BotListByUID.erase(this->uid); diff --git a/src/modules.cpp b/src/modules.cpp index 63e6bcab3..1ca060108 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -173,6 +173,9 @@ int Module::DelCommand(BotInfo *bi, Command *c) if (!bi->Commands.erase(c->name)) return MOD_ERR_NOEXIST; + + c->module = NULL; + c->service = NULL; return MOD_ERR_OK; } |