]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_close.cpp
Merge branch 'master+writenumeric'
[user/henk/code/inspircd.git] / src / modules / m_close.cpp
index f8bac669dff50b21305bec99b8cb5716470390eb..3f0eedaafcfb9e961ddf779422b37ee75fc306e5 100644 (file)
@@ -35,9 +35,12 @@ class CommandClose : public Command
        {
                std::map<std::string,int> closed;
 
-               for (UserManager::LocalList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u)
+               const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+               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");