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