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_posix.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_posix.cpp')
-rw-r--r-- | modules/extra/m_regex_posix.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/extra/m_regex_posix.cpp b/modules/extra/m_regex_posix.cpp index 551d978b8..e6610db07 100644 --- a/modules/extra/m_regex_posix.cpp +++ b/modules/extra/m_regex_posix.cpp @@ -51,6 +51,26 @@ class ModuleRegexPOSIX : public Module { this->SetPermanent(true); } + + ~ModuleRegexPOSIX() + { + 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<POSIXRegex *>(x->regex)) + { + delete x->regex; + x->regex = NULL; + } + } + } + } }; MODULE_INIT(ModuleRegexPOSIX) |