Changes variables destructor to virtual

Avoid memory leak while destroying the Variable objects.
This commit is contained in:
Felipe Zimmerle
2017-01-06 10:58:54 -03:00
committed by Felipe Zimmerle
parent 0c37ba336b
commit 557c29fd46
3 changed files with 4 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ class Variable {
explicit Variable(std::string _name);
Variable(std::string name, VariableKind kind);
virtual ~Variable() { }
static std::string to_s(std::vector<Variable *> *variables);

View File

@@ -34,6 +34,7 @@ class Count : public Variable {
explicit Count(Variable *v)
: Variable("count(" + v->m_name + ")"),
var(v) { }
virtual ~Count() { delete var; }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) override;

View File

@@ -37,6 +37,8 @@ class Exclusion : public Variable {
var(v)
{ m_isExclusion = true; }
virtual ~Exclusion() { delete var; }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) override;