summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-29 14:34:19 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-29 14:34:19 +0200
commit19295ade368e9691b9d4f3152520284c7ad67b13 (patch)
tree15f875c9c0ba810068f7cf5913c0659fb2e72ac1 /src
parent6c4a6b1753926f7de2cc210bf25d1b3c87c181e9 (diff)
Unregister modes before unhooking extensions when unloading a module
Listmodes store their list in an extension that must be present when they are unset to show the modes being unset
Diffstat (limited to 'src')
-rw-r--r--src/modules.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 567aa917c..5c5e5c5c0 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -363,6 +363,10 @@ void ModuleManager::DoSafeUnload(Module* mod)
std::map<std::string, Module*>::iterator modfind = Modules.find(mod->ModuleSourceFile);
+ // Unregister modes before extensions because modes may require their extension to show the mode being unset
+ UnregisterModes(mod, MODETYPE_USER);
+ UnregisterModes(mod, MODETYPE_CHANNEL);
+
std::vector<reference<ExtensionItem> > items;
ServerInstance->Extensions.BeginUnregister(modfind->second, items);
/* Give the module a chance to tidy out all its metadata */
@@ -388,9 +392,6 @@ void ModuleManager::DoSafeUnload(Module* mod)
user->doUnhookExtensions(items);
}
- UnregisterModes(mod, MODETYPE_USER);
- UnregisterModes(mod, MODETYPE_CHANNEL);
-
for(std::multimap<std::string, ServiceProvider*>::iterator i = DataProviders.begin(); i != DataProviders.end(); )
{
std::multimap<std::string, ServiceProvider*>::iterator curr = i++;