From 6f84254ed6681c79d606679cecb9420d394c8c47 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 9 Jan 2008 12:20:21 +0000 Subject: Add OnExpireLine(XLine *) hook, will be used in xline db stuff to avoid getting a fucked up vector git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8676 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/xline.cpp') diff --git a/src/xline.cpp b/src/xline.cpp index a77f7dc0b..1dda8dac0 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -289,19 +289,21 @@ XLine* XLineManager::MatchesLine(const std::string &type, const std::string &pat // removes lines that have expired void XLineManager::ExpireLine(ContainerIter container, LookupIter item) { - item->second->DisplayExpiry(); - item->second->Unset(); - - /* TODO: Can we skip this loop by having a 'pending' field in the XLine class, which is set when a line - * is pending, cleared when it is no longer pending, so we skip over this loop if its not pending? - * -- Brain - */ - std::vector::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), item->second); - if (pptr != pending_lines.end()) - pending_lines.erase(pptr); - - delete item->second; - container->second.erase(item); + FOREACH_MOD(I_OnExpireLine, OnExpireLine(item->second)); + + item->second->DisplayExpiry(); + item->second->Unset(); + + /* TODO: Can we skip this loop by having a 'pending' field in the XLine class, which is set when a line + * is pending, cleared when it is no longer pending, so we skip over this loop if its not pending? + * -- Brain + */ + std::vector::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), item->second); + if (pptr != pending_lines.end()) + pending_lines.erase(pptr); + + delete item->second; + container->second.erase(item); } -- cgit v1.2.3