diff options
author | Adam <Adam@anope.org> | 2015-09-23 14:54:41 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-09-23 14:55:28 -0400 |
commit | 93a92bb73b33b9970a6483f153170442eff95941 (patch) | |
tree | 9c3a8399bcce6559c35f2ecedeebd5a70a77e688 /modules/extra/m_regex_tre.cpp | |
parent | b9dc44ae9a63ce739be20da82c8b5ec5cda12154 (diff) |
Clear regex xlines on unload, which happens on shutdown, even though they are perm modules
Diffstat (limited to 'modules/extra/m_regex_tre.cpp')
-rw-r--r-- | modules/extra/m_regex_tre.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/extra/m_regex_tre.cpp b/modules/extra/m_regex_tre.cpp index 760097b08..52c054888 100644 --- a/modules/extra/m_regex_tre.cpp +++ b/modules/extra/m_regex_tre.cpp @@ -52,6 +52,26 @@ class ModuleRegexTRE : public Module { this->SetPermanent(true); } + + ~ModuleRegexTRE() + { + for (std::list<XLineManager *>::iterator it = XLineManager::XLineManagers.begin(); it != XLineManager::XLineManagers.end(); ++it) + { + XLineManager *xlm = *it; + const std::vector<XLine *> &xlines = xlm->GetList(); + + for (unsigned int i = 0; i < xlines.size(); ++i) + { + XLine *x = xlines[i]; + + if (x->regex && dynamic_cast<TRERegex *>(x->regex)) + { + delete x->regex; + x->regex = NULL; + } + } + } + } }; MODULE_INIT(ModuleRegexTRE) |