diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:50:50 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:50:50 +0000 |
commit | bbaf9002a8cf427b2cbe93fd34a112e3d5f445ac (patch) | |
tree | 71ed941d06148a4999336c11d46305632ba30062 | |
parent | 94a601fb3b67e72e075af28174094117cd09f5f2 (diff) |
Fix segfault due to invalidated iterator
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11641 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/userprocess.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp index d66e548c9..4fcf87f66 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -142,9 +142,11 @@ void InspIRCd::DoBackgroundUserStuff() /* * loop over all local users.. */ - for (std::vector<User*>::iterator count2 = this->Users->local_users.begin(); count2 != this->Users->local_users.end(); count2++) + std::vector<User*>::reverse_iterator count2 = this->Users->local_users.rbegin(); + while (count2 != this->Users->local_users.rend()) { User *curr = *count2; + count2++; if (curr->quitting) continue; |