summaryrefslogtreecommitdiff
path: root/src/modmanager_dynamic.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-16 17:59:06 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-16 17:59:06 +0000
commit54fb0cd5aa7d090d5c3da5ab54988c86ba8a2e8e (patch)
treebc20ce6dca41b2d16349ae4c8212861c10e3685e /src/modmanager_dynamic.cpp
parent3bfd0db65ff01c026e968af4de074cc1155a4061 (diff)
Use ServiceProvider for inter-module dependencies
This will stop dependency chains from preventing module reloads when it is not actually needed; however, it removes some failsafes that will need to be reimplemented in order to avoid unmapped vtables. This deprecates Request as an inter-module signaling mechanism, although SQL still uses it. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12140 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modmanager_dynamic.cpp')
-rw-r--r--src/modmanager_dynamic.cpp15
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);