From 05e925b4f10d8ed53793e5f69194b59d18448345 Mon Sep 17 00:00:00 2001 From: Adam Wardynski <award@.(B-4.4.46a)> Date: Thu, 25 Nov 2010 21:11:47 +0100 Subject: [PATCH] Add virtual destructor to Expression, just in case. Doesn't hurt and can help. --- libwccl/ops/expression.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libwccl/ops/expression.h b/libwccl/ops/expression.h index 8d3e71a..a49cb1e 100644 --- a/libwccl/ops/expression.h +++ b/libwccl/ops/expression.h @@ -9,7 +9,8 @@ namespace Wccl { /** * Abstract base class for WCCL expressions */ -class Expression : public boost::noncopyable { +class Expression : boost::noncopyable +{ public: /** * @returns String representation of the expression. @@ -21,6 +22,13 @@ public: * @note Might be incomplete and/or contain internal info. */ virtual std::string to_raw_string() const = 0; + + /** + * Virtual destructor, so if delete is ever called on a base-class-type + * of pointer, the destruction is forwarded to proper destructor + * in a derived class, if a special destructor was needed for that class. + */ + virtual ~Expression() {}; }; } /* end ns Wccl */ -- GitLab