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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user