X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_close.cpp;h=3f0eedaafcfb9e961ddf779422b37ee75fc306e5;hb=761e6d75ba37b984998952940ed681e79e456142;hp=f3c751f177558f9df8af90a690657206c7745629;hpb=6fe1f4e1136f2ab95a88e68af1894bf6002d03f4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index f3c751f17..3f0eedaaf 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -36,9 +36,11 @@ class CommandClose : public Command std::map closed; const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); ++u) + for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); ) { + // Quitting the user removes it from the list LocalUser* user = *u; + ++u; if (user->registered != REG_ALL) { ServerInstance->Users->QuitUser(user, "Closing all unknown connections per request");