From 97d0794c7c267204ff09334e1eb86e6f17afc641 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Fri, 27 Sep 2013 04:39:35 +0200 Subject: [PATCH] Remove Serializable's virtual destructor. It didn't do anything anyway. To still make the compiler happy, add virtual destructors to all descendants of Serializable. --- src/etc.h | 6 ++++++ src/serializable.h | 2 -- src/table.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/etc.h b/src/etc.h index 19609ba..9f76059 100644 --- a/src/etc.h +++ b/src/etc.h @@ -48,6 +48,8 @@ struct Color : public Serializable Color(const Vec4 &norm); Color(const Color &o); + virtual ~Color() {} + bool operator==(const Color &o) const; void updateInternal(); @@ -95,6 +97,8 @@ struct Tone : public Serializable Tone(double red, double green, double blue, double gray = 0); Tone(const Tone &o); + virtual ~Tone() {} + bool operator==(const Tone &o) const; void updateInternal(); @@ -140,6 +144,8 @@ struct Rect : public Serializable : x(0), y(0), width(0), height(0) {} + virtual ~Rect() {} + Rect(int x, int y, int width, int height); Rect(const Rect &o); Rect(const IntRect &r); diff --git a/src/serializable.h b/src/serializable.h index c04cf04..0810be4 100644 --- a/src/serializable.h +++ b/src/serializable.h @@ -24,8 +24,6 @@ struct Serializable { - virtual ~Serializable() {} - virtual int serialSize() const = 0; virtual void serialize(char *buffer) const = 0; }; diff --git a/src/table.h b/src/table.h index 53c259e..94a0b03 100644 --- a/src/table.h +++ b/src/table.h @@ -31,7 +31,7 @@ class Table : public Serializable { public: Table(int x, int y = 1, int z = 1); - ~Table(); + virtual ~Table(); int xSize() const { return m_x; } int ySize() const { return m_y; }