diff options
author | Adam <Adam@anope.org> | 2011-02-09 21:55:11 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-09 21:55:11 -0500 |
commit | 634e9af9cb9dc379bf898a968eb2f4a50adf434d (patch) | |
tree | 4fc3588faa869135ec593a8dab1b5675723821c6 | |
parent | b6ab031fc18225ae720d74169ba4963c03d9ffc8 (diff) |
Fixed expiring session exceptions
-rw-r--r-- | src/sessions.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sessions.cpp b/src/sessions.cpp index f13683050..c125a4cb0 100644 --- a/src/sessions.cpp +++ b/src/sessions.cpp @@ -210,17 +210,16 @@ void del_session(const Anope::string &host) void expire_exceptions() { - for (std::vector<Exception *>::iterator it = exceptions.begin(), it_end = exceptions.end(); it != it_end; ) + for (unsigned i = exceptions.size(); i > 0; --i) { - Exception *e = *it; - std::vector<Exception *>::iterator curr_it = it++; + Exception *e = exceptions[i - 1]; if (!e->expires || e->expires > Anope::CurTime) continue; if (Config->WallExceptionExpire) ircdproto->SendGlobops(OperServ, "Session limit exception for %s has expired.", e->mask.c_str()); delete e; - exceptions.erase(curr_it); + exceptions.erase(exceptions.begin() + i - 1); } } |