From 35f03811e899f7cef01a1d84f1167bdb43365e13 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 1 Dec 2010 15:50:56 -0500 Subject: [PATCH] Fixed clearing entries from the bandata cache --- src/botserv.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/botserv.cpp b/src/botserv.cpp index df1476dc8..9149a0027 100644 --- a/src/botserv.cpp +++ b/src/botserv.cpp @@ -387,8 +387,12 @@ static BanData *get_ban_data(Channel *c, User *u) return NULL; Anope::string mask = u->GetIdent() + "@" + u->GetDisplayedHost(); - for (std::list::iterator it = c->bd.begin(), it_end = c->bd.end(); it != it_end; ++it) + /* XXX This should really be on some sort of timer/garbage collector, and use std::map */ + for (std::list::iterator it = c->bd.begin(), it_end = c->bd.end(), it_next; it != it_end; it = it_next) { + it_next = it; + ++it_next; + if (Anope::CurTime - (*it)->last_use > Config->BSKeepData) { delete *it;