From 9fd34b8cdc98ee757fc047216bd51c698cb7b82f Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 2 May 2012 00:03:59 +1000 Subject: Fix up some memory leaking issues. --- impl/Expression.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'impl/Expression.hpp') diff --git a/impl/Expression.hpp b/impl/Expression.hpp index 7b157c2..668f4fd 100644 --- a/impl/Expression.hpp +++ b/impl/Expression.hpp @@ -5,17 +5,14 @@ #include "VariableAssignment.hpp" #include "Operator.hpp" +int ExpressionCount; + template struct Expression { Expression(Operator* op, const std::vector< Expression* >& args) : _operator(op), _arguments(args) { } virtual ~Expression() { - /*delete _operator; - for (typename std::vector< Expression* >::iterator it = _arguments.begin(); - it != _arguments.end(); - ++it) { - delete *it; - }*/ + delete _operator; } virtual T operator() (const VariableAssignment& assignment) const { return (*_operator)(_arguments, assignment); -- cgit v1.2.3