Base classes used polymorphically whose child classes have data members or

destructors must themselves have virtual destructors or Bad Things(TM)
happen.
This commit is contained in:
JoelKatz
2012-09-10 16:29:42 -07:00
parent b7f3baee15
commit 4faad38112
3 changed files with 5 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ public:
virtual bool work(Interpreter* interpreter)=0;
virtual int getFee();
virtual ~Operation() { ; }
};
// this is just an Int in the code