aboutsummaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-04-28 00:32:14 +0200
committerGravatar attilamolnar2013-04-28 00:32:14 +0200
commit8790551dc182cd8804ee7d8ef89ccb31067cc2a4 (patch)
treefa411b244ae8541e49eb126a9d15a7b5a13504db /src/modules.cpp
parentAdded RMODE command per suggestion #479 (diff)
parentRelease 2.0.12 (diff)
Merge insp20
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index c9118d1a7..63e1118d9 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -327,7 +327,7 @@ bool ModuleManager::CanUnload(Module* mod)
{
std::map<std::string, Module*>::iterator modfind = Modules.find(mod->ModuleSourceFile);
- if (modfind == Modules.end() || modfind->second != mod)
+ if ((modfind == Modules.end()) || (modfind->second != mod) || (mod->dying))
{
LastModuleError = "Module " + mod->ModuleSourceFile + " is not loaded, cannot unload it!";
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError);
@@ -339,6 +339,8 @@ bool ModuleManager::CanUnload(Module* mod)
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError);
return false;
}
+
+ mod->dying = true;
return true;
}