summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-15 21:25:30 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-15 21:25:30 +0000
commit01c23b31f7d0ea87052cd22814af826ecb11f0f3 (patch)
tree53743a6950d0ddafe6c8319eecf09b1c6d1687a2 /src/modules.cpp
parent94d7827e8b101b528c427298fada73664970cf26 (diff)
Remove Extensible items from user, channel, and Membership on module unload
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11730 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 48b477658..51fecb47c 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -538,26 +538,30 @@ bool ModuleManager::Unload(const char* filename)
return false;
}
+ std::vector<ExtensionItem*> items = Extensible::BeginUnregister(modfind->second.second);
/* Give the module a chance to tidy out all its metadata */
for (chan_hash::iterator c = ServerInstance->chanlist->begin(); c != ServerInstance->chanlist->end(); c++)
{
modfind->second.second->OnCleanup(TYPE_CHANNEL,c->second);
+ c->second->doUnhookExtensions(items);
+ const UserMembList* users = c->second->GetUsers();
+ for(UserMembCIter mi = users->begin(); mi != users->end(); mi++)
+ mi->second->doUnhookExtensions(items);
}
for (user_hash::iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++)
{
modfind->second.second->OnCleanup(TYPE_USER,u->second);
+ u->second->doUnhookExtensions(items);
}
/* Tidy up any dangling resolvers */
ServerInstance->Res->CleanResolvers(modfind->second.second);
-
FOREACH_MOD_I(ServerInstance,I_OnUnloadModule,OnUnloadModule(modfind->second.second, modfind->first));
this->DetachAll(modfind->second.second);
ServerInstance->Parser->RemoveCommands(modfind->second.second);
- Extensible::UnRegister(modfind->second.second);
delete modfind->second.second;
delete modfind->second.first;