mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-24 20:27:22 +01:00
see #2221 fixed memory leak: need to delete rule processors when compiler finishes
This commit is contained in:
parent
5893edb768
commit
393a53b64b
@ -218,23 +218,7 @@ Compiler::Compiler(FWObjectDatabase*, bool ipv6_policy)
|
||||
|
||||
Compiler::~Compiler()
|
||||
{
|
||||
#ifdef DBCOPY_IS_TRUE_COPY
|
||||
if (dbcopy)
|
||||
{
|
||||
if (dbcopy->verifyTree())
|
||||
{
|
||||
cerr << "source_ruleset=" << source_ruleset << endl;
|
||||
cerr << "temp_ruleset=" << temp_ruleset << endl;
|
||||
// dbcopy->dump(true, true);
|
||||
}
|
||||
|
||||
if (persistent_objects != NULL)
|
||||
dbcopy->remove(persistent_objects, false);
|
||||
|
||||
delete dbcopy;
|
||||
}
|
||||
#endif
|
||||
|
||||
deleteRuleProcessors();
|
||||
dbcopy = NULL;
|
||||
}
|
||||
|
||||
@ -692,12 +676,12 @@ void Compiler::runRuleProcessors()
|
||||
|
||||
void Compiler::deleteRuleProcessors()
|
||||
{
|
||||
list<BasicRuleProcessor*>::iterator i=rule_processors.begin();
|
||||
for ( ; i!=rule_processors.end(); ++i)
|
||||
while (rule_processors.size() > 0)
|
||||
{
|
||||
delete *i;
|
||||
BasicRuleProcessor *rp = rule_processors.front();
|
||||
rule_processors.pop_front();
|
||||
delete rp;
|
||||
}
|
||||
rule_processors.clear();
|
||||
}
|
||||
|
||||
Compiler::Begin::Begin() : BasicRuleProcessor("")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user