From: bdemsky Date: Sat, 26 Aug 2017 00:18:32 +0000 (-0700) Subject: Fix memory leaks X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9f703a622069cbfa76ef2e2efb393ab1714c0342;p=satune.git Fix memory leaks --- diff --git a/src/AST/boolean.h b/src/AST/boolean.h index d958dc0..4bab811 100644 --- a/src/AST/boolean.h +++ b/src/AST/boolean.h @@ -20,6 +20,7 @@ class Boolean : public ASTNode { public: Boolean(ASTNodeType _type); + virtual ~Boolean() {} Polarity polarity; BooleanValue boolVal; Vector parents; diff --git a/src/AST/element.h b/src/AST/element.h index fe5f42b..6a8ea95 100644 --- a/src/AST/element.h +++ b/src/AST/element.h @@ -13,7 +13,7 @@ class Element : public ASTNode { public: Element(ASTNodeType type); - ~Element(); + virtual ~Element(); Vector parents; ElementEncoding encoding; MEMALLOC; diff --git a/src/AST/predicate.h b/src/AST/predicate.h index c59a6a6..96f462d 100644 --- a/src/AST/predicate.h +++ b/src/AST/predicate.h @@ -10,6 +10,7 @@ class Predicate { public: Predicate(PredicateType _type) : type(_type) {} + virtual ~Predicate() {} PredicateType type; MEMALLOC; }; diff --git a/src/csolver.cc b/src/csolver.cc index cdbb919..64f0851 100644 --- a/src/csolver.cc +++ b/src/csolver.cc @@ -155,7 +155,7 @@ Boolean *CSolver::applyPredicate(Predicate *predicate, Element **inputs, uint nu } Boolean *CSolver::applyPredicateTable(Predicate *predicate, Element **inputs, uint numInputs, Boolean *undefinedStatus) { - Boolean *boolean = new BooleanPredicate(predicate, inputs, numInputs, undefinedStatus); + BooleanPredicate *boolean = new BooleanPredicate(predicate, inputs, numInputs, undefinedStatus); allBooleans.push(boolean); return boolean; }