diff options
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
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<XLine*>::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<XLine*>::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); } |