diff options
Diffstat (limited to 'src/modmanager_dynamic.cpp')
-rw-r--r-- | src/modmanager_dynamic.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index 156105ad8..bbbaf7b53 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -152,13 +152,6 @@ bool ModuleManager::CanUnload(Module* mod) ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); return false; } - std::pair<int,std::string> intercount = GetInterfaceInstanceCount(mod); - if (intercount.first > 0) - { - LastModuleError = "Failed to unload module " + mod->ModuleSourceFile + ", being used by " + ConvToStr(intercount.first) + " other(s) via interface '" + intercount.second + "'"; - ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); - return false; - } return true; } @@ -192,6 +185,14 @@ void ModuleManager::DoSafeUnload(Module* mod) if (mh && mh->creator == mod) ServerInstance->Modes->DelMode(mh); } + for(std::multimap<std::string, ServiceProvider*>::iterator i = DataProviders.begin(); i != DataProviders.end(); ) + { + std::multimap<std::string, ServiceProvider*>::iterator curr = i++; + if (curr->second->creator == mod) + DataProviders.erase(curr); + } + for(unsigned int i = 0; i < ServerInstance->Modules->ActiveDynrefs.size(); i++) + ServerInstance->Modules->ActiveDynrefs[i]->ClearCache(); /* Tidy up any dangling resolvers */ ServerInstance->Res->CleanResolvers(mod); |