From 4faad381120f2bae2cee8dccc7e6347598589e95 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 10 Sep 2012 16:29:42 -0700 Subject: [PATCH] Base classes used polymorphically whose child classes have data members or destructors must themselves have virtual destructors or Bad Things(TM) happen. --- src/Operation.h | 2 ++ src/ScriptData.h | 2 ++ src/TransactionMeta.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/Operation.h b/src/Operation.h index 9fca2498c..11c37d38f 100644 --- a/src/Operation.h +++ b/src/Operation.h @@ -12,6 +12,8 @@ public: virtual bool work(Interpreter* interpreter)=0; virtual int getFee(); + + virtual ~Operation() { ; } }; // this is just an Int in the code diff --git a/src/ScriptData.h b/src/ScriptData.h index af9ce45c0..66fe2ed3e 100644 --- a/src/ScriptData.h +++ b/src/ScriptData.h @@ -9,6 +9,8 @@ class Data public: typedef boost::shared_ptr pointer; + virtual ~Data(){ ; } + virtual bool isInt32(){ return(false); } virtual bool isFloat(){ return(false); } virtual bool isUint160(){ return(false); } diff --git a/src/TransactionMeta.h b/src/TransactionMeta.h index 729a72480..b62f9f361 100644 --- a/src/TransactionMeta.h +++ b/src/TransactionMeta.h @@ -46,6 +46,7 @@ protected: public: TransactionMetaNodeEntry(int type) : mType(type) { ; } + virtual ~TransactionMetaNodeEntry() { ; } int getType() const { return mType; } virtual Json::Value getJson(int) const = 0;