From 54fb0cd5aa7d090d5c3da5ab54988c86ba8a2e8e Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 16 Nov 2009 17:59:06 +0000 Subject: 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 --- src/modmanager_dynamic.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/modmanager_dynamic.cpp') 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 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::iterator i = DataProviders.begin(); i != DataProviders.end(); ) + { + std::multimap::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); -- cgit v1.2.3