summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-09-23 14:54:41 -0400
committerAdam <Adam@anope.org>2015-09-23 14:55:28 -0400
commit93a92bb73b33b9970a6483f153170442eff95941 (patch)
tree9c3a8399bcce6559c35f2ecedeebd5a70a77e688 /modules
parentb9dc44ae9a63ce739be20da82c8b5ec5cda12154 (diff)
Clear regex xlines on unload, which happens on shutdown, even though they are perm modules
Diffstat (limited to 'modules')
-rw-r--r--modules/extra/m_regex_pcre.cpp20
-rw-r--r--modules/extra/m_regex_posix.cpp20
-rw-r--r--modules/extra/m_regex_tre.cpp20
3 files changed, 60 insertions, 0 deletions
diff --git a/modules/extra/m_regex_pcre.cpp b/modules/extra/m_regex_pcre.cpp
index 7cbde87db..180fb9949 100644
--- a/modules/extra/m_regex_pcre.cpp
+++ b/modules/extra/m_regex_pcre.cpp
@@ -50,6 +50,26 @@ class ModuleRegexPCRE : public Module
{
this->SetPermanent(true);
}
+
+ ~ModuleRegexPCRE()
+ {
+ 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<PCRERegex *>(x->regex))
+ {
+ delete x->regex;
+ x->regex = NULL;
+ }
+ }
+ }
+ }
};
MODULE_INIT(ModuleRegexPCRE)
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)
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)