From 78f7265d8d33452820f9f7642f449681a1557f75 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 31 Oct 2007 20:54:27 +0000 Subject: Start to fix broken expiry git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8445 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/xline.cpp b/src/xline.cpp index 9d0b12fa3..3c1259eac 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -6,7 +6,7 @@ * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see - * the file COPYING for details. + * the file COPYING for details. * * --------------------------------------------------- */ @@ -169,7 +169,6 @@ bool XLineManager::DelLine(const char* hostmask, char type, User* user, bool sim if (!simulate) { (*i)->Unset(); - delete *i; active_lines.erase(i); if (lookup_lines.find(type) != lookup_lines.end()) lookup_lines[type].erase(hostmask); @@ -179,6 +178,8 @@ bool XLineManager::DelLine(const char* hostmask, char type, User* user, bool sim std::vector::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), *i); if (pptr != pending_lines.end()) pending_lines.erase(pptr); + + delete *i; } return true; } @@ -370,7 +371,15 @@ void XLineManager::expire_lines() std::vector::iterator i = active_lines.begin(); (*i)->DisplayExpiry(); (*i)->Unset(); + active_lines.erase(i); + if (lookup_lines.find((*i)->type) != lookup_lines.end()) + lookup_lines[(*i)->type].erase((*i)->Displayable()); + + std::vector::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), *i); + if (pptr != pending_lines.end()) + pending_lines.erase(pptr); + delete *i; } } -- cgit v1.2.3