diff options
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) |