From bbaf9002a8cf427b2cbe93fd34a112e3d5f445ac Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:50:50 +0000 Subject: Fix segfault due to invalidated iterator git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11641 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/userprocess.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/userprocess.cpp') 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::iterator count2 = this->Users->local_users.begin(); count2 != this->Users->local_users.end(); count2++) + std::vector::reverse_iterator count2 = this->Users->local_users.rbegin(); + while (count2 != this->Users->local_users.rend()) { User *curr = *count2; + count2++; if (curr->quitting) continue; -- cgit v1.2.3