summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules.c b/src/modules.c
index e0d0f8556..70d4621c5 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -720,10 +720,6 @@ int unloadModule(Module * m, User * u)
return MOD_ERR_NOUNLOAD;
}
- if (prepForUnload(mod_current_module) != MOD_ERR_OK) {
- return MOD_ERR_UNKNOWN;
- }
-
func = (void (*)(void))ano_modsym(m->handle, "AnopeFini");
if (func) {
mod_current_module_name = m->name;
@@ -731,6 +727,10 @@ int unloadModule(Module * m, User * u)
mod_current_module_name = NULL;
}
+ if (prepForUnload(m) != MOD_ERR_OK) {
+ return MOD_ERR_UNKNOWN;
+ }
+
if ((ano_modclose(m->handle)) != 0) {
alog(ano_moderr());
if (u) {