summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-05 18:23:44 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-05 18:23:44 +0200
commit0fa365373eb9110a05ee4be5c36c9757c30f1a25 (patch)
tree54bb2e558a5bb8f2416e32977db6b767d7eb6f84 /src/modules.cpp
parent08a566b5d7f4a9c1bafd4bf74d2a05ed8010d6b6 (diff)
Don't attempt to unload or reload modules that are waiting to be unloaded
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 4e4d20c70..a7b3364ae 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -328,7 +328,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", DEFAULT, LastModuleError);
@@ -340,6 +340,8 @@ bool ModuleManager::CanUnload(Module* mod)
ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
return false;
}
+
+ mod->dying = true;
return true;
}