diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base.cpp | 6 | ||||
-rw-r--r-- | src/inspircd.cpp | 1 | ||||
-rw-r--r-- | src/mode.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 13 |
4 files changed, 15 insertions, 7 deletions
diff --git a/src/base.cpp b/src/base.cpp index 59196fec1..2a89a4830 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -20,8 +20,7 @@ classbase::classbase() { if (ServerInstance && ServerInstance->Logs) - ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::+%s @%p", - typeid(*this).name(), (void*)this); + ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::+ @%p", (void*)this); } CullResult classbase::cull() @@ -35,8 +34,7 @@ CullResult classbase::cull() classbase::~classbase() { if (ServerInstance && ServerInstance->Logs) - ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::~%s @%p", - typeid(*this).name(), (void*)this); + ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::~ @%p", (void*)this); } CullResult::CullResult() diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8b1bd3e44..3c9643486 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -111,6 +111,7 @@ void InspIRCd::Cleanup() /* Delete objects dynamically allocated in constructor (destructor would be more appropriate, but we're likely exiting) */ /* Must be deleted before modes as it decrements modelines */ + FakeClient->cull(); DeleteZero(this->FakeClient); DeleteZero(this->Users); DeleteZero(this->Modes); diff --git a/src/mode.cpp b/src/mode.cpp index 65a027e90..c8ab6cc62 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -63,7 +63,7 @@ CullResult ModeHandler::cull() ModeHandler::~ModeHandler() { if (ServerInstance && ServerInstance->Modes && ServerInstance->Modes->FindMode(mode, m_type) == this) - ServerInstance->Logs->Log("MODE", DEBUG, "ERROR: Destructor for mode %c called while not culled", mode); + ServerInstance->Logs->Log("MODE", ERROR, "ERROR: Destructor for mode %c called while still registered", mode); } bool ModeHandler::IsListMode() diff --git a/src/modules.cpp b/src/modules.cpp index 8957b4bb6..c5bd87cde 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -476,6 +476,16 @@ void ModuleManager::DoSafeUnload(Module* mod) mod->OnCleanup(TYPE_USER,u->second); u->second->doUnhookExtensions(items); } + for(char m='A'; m < 'z'; m++) + { + ModeHandler* mh; + mh = ServerInstance->Modes->FindMode(m, MODETYPE_USER); + if (mh && mh->creator == mod) + ServerInstance->Modes->DelMode(mh); + mh = ServerInstance->Modes->FindMode(m, MODETYPE_CHANNEL); + if (mh && mh->creator == mod) + ServerInstance->Modes->DelMode(mh); + } /* Tidy up any dangling resolvers */ ServerInstance->Res->CleanResolvers(mod); @@ -607,8 +617,7 @@ void ModuleManager::UnloadAll() std::map<std::string, Module*>::iterator me = i++; if (CanUnload(me->second)) { - ServerInstance->GlobalCulls.AddItem(me->second); - Modules.erase(me); + DoSafeUnload(me->second); } } ServerInstance->GlobalCulls.Apply(); |