From 0fa365373eb9110a05ee4be5c36c9757c30f1a25 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 5 Apr 2013 18:23:44 +0200 Subject: Don't attempt to unload or reload modules that are waiting to be unloaded --- src/modules.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules.cpp') 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::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; } -- cgit v1.2.3