X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules.cpp;h=a4b5ae4bc37653dbfdd04a869187adc08550c817;hb=8f31b0cf2a753cd7b6af8fd1dc730d0693ebeb90;hp=3723b09c333ed537fbb8f0504681b912c2a49ba5;hpb=5a64433015f5a25af133a136468093a140595bc5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules.cpp b/src/modules.cpp index 3723b09c3..a4b5ae4bc 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -390,7 +390,8 @@ void ModuleManager::DoSafeUnload(Module* mod) std::vector > items; ServerInstance->Extensions.BeginUnregister(modfind->second, items); /* Give the module a chance to tidy out all its metadata */ - for (chan_hash::iterator c = ServerInstance->chanlist->begin(); c != ServerInstance->chanlist->end(); ) + const chan_hash& chans = ServerInstance->GetChans(); + for (chan_hash::const_iterator c = chans.begin(); c != chans.end(); ) { Channel* chan = c->second; ++c; @@ -400,7 +401,9 @@ void ModuleManager::DoSafeUnload(Module* mod) 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(); ) + + const user_hash& users = ServerInstance->Users->GetUsers(); + for (user_hash::const_iterator u = users.begin(); u != users.end(); ) { User* user = u->second; // The module may quit the user (e.g. SSL mod unloading) and that will remove it from the container @@ -410,17 +413,19 @@ void ModuleManager::DoSafeUnload(Module* mod) } const ModeParser::ModeHandlerMap& usermodes = ServerInstance->Modes->GetModes(MODETYPE_USER); - for (ModeParser::ModeHandlerMap::const_iterator i = usermodes.begin(); i != usermodes.end(); ++i) + for (ModeParser::ModeHandlerMap::const_iterator i = usermodes.begin(); i != usermodes.end(); ) { ModeHandler* mh = i->second; + ++i; if (mh->creator == mod) this->DelService(*mh); } const ModeParser::ModeHandlerMap& chanmodes = ServerInstance->Modes->GetModes(MODETYPE_CHANNEL); - for (ModeParser::ModeHandlerMap::const_iterator i = chanmodes.begin(); i != chanmodes.end(); ++i) + for (ModeParser::ModeHandlerMap::const_iterator i = chanmodes.begin(); i != chanmodes.end(); ) { ModeHandler* mh = i->second; + ++i; if (mh->creator == mod) this->DelService(*mh); }