1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 13:03:14 +02:00

Clear regex xlines on unload, which happens on shutdown, even though they are perm modules

This commit is contained in:
Adam
2015-09-23 14:54:41 -04:00
parent b9dc44ae9a
commit 93a92bb73b
3 changed files with 60 additions and 0 deletions
+20
View File
@@ -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)
+20
View File
@@ -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)
+20
View File
@@ -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)