]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
Fix sqllog compile error
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index 156105ad8db041a6801efe430dbc2a05f3ac3522..bbbaf7b532a0dfdb41949d60658039470f44d3ca 100644 (file)
@@ -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);