Moving the rules deletion to the RuleProperties class

The deletion was happning on the Rule class due to historical reasons.
The consequence of that was a parser memory leak.
This commit is contained in:
Felipe Zimmerle
2017-01-06 01:09:41 -03:00
committed by Felipe Zimmerle
parent 068a3eb517
commit a8e5cce744
5 changed files with 36 additions and 29 deletions

View File

@@ -84,15 +84,17 @@ class Rule {
Rule *chainedRule;
bool chained;
void refCountDecreaseAndCheck() {
this->m_referenceCount--;
if (this->m_referenceCount == 0) {
int refCountDecreaseAndCheck() {
m_referenceCount--;
if (m_referenceCount == 0) {
delete this;
return 1;
}
return 0;
}
void refCountIncrease() {
this->m_referenceCount++;
m_referenceCount++;
}
std::string m_rev;