1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 06:06:38 +02:00

Fixed clearing entries from the bandata cache

This commit is contained in:
Adam
2010-12-01 15:50:56 -05:00
parent 14e396baf7
commit 35f03811e8
+5 -1
View File
@@ -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<BanData *>::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<BanData *>::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;