summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp13
1 files changed, 11 insertions, 2 deletions
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();