diff --git a/SDL2pp/Exception.cc b/SDL2pp/Exception.cc index 18cf4d4..5942661 100644 --- a/SDL2pp/Exception.cc +++ b/SDL2pp/Exception.cc @@ -28,6 +28,10 @@ namespace SDL2pp { Exception::Exception(const char* what) : what_(what), sdl_error_(SDL_GetError()) { } +Exception::~Exception() noexcept { + // nothing to do +} + const char* Exception::what() const noexcept { return what_; } diff --git a/SDL2pp/Exception.hh b/SDL2pp/Exception.hh index 4f46890..d4ffc8e 100644 --- a/SDL2pp/Exception.hh +++ b/SDL2pp/Exception.hh @@ -33,6 +33,7 @@ private: public: Exception(const char* what = ""); + virtual ~Exception() noexcept; const char* what() const noexcept; const char* GetSDLError() const noexcept; }; diff --git a/SDL2pp/Point.hh b/SDL2pp/Point.hh index 69e06c1..13703d5 100644 --- a/SDL2pp/Point.hh +++ b/SDL2pp/Point.hh @@ -45,7 +45,7 @@ private: public: Point(int x, int y); - ~Point(); + virtual ~Point(); static Point Null(); diff --git a/SDL2pp/Rect.hh b/SDL2pp/Rect.hh index 3cdf9ac..8c20d84 100644 --- a/SDL2pp/Rect.hh +++ b/SDL2pp/Rect.hh @@ -37,7 +37,7 @@ private: public: Rect(int x, int y, int w, int h); - ~Rect(); + virtual ~Rect(); static Rect Null(); diff --git a/SDL2pp/Renderer.hh b/SDL2pp/Renderer.hh index 7d7c37e..600cd0f 100644 --- a/SDL2pp/Renderer.hh +++ b/SDL2pp/Renderer.hh @@ -39,7 +39,7 @@ private: public: Renderer(Window& window, int index, Uint32 flags); - ~Renderer(); + virtual ~Renderer(); Renderer(const Renderer& other) = delete; Renderer(Renderer&& other) = delete; diff --git a/SDL2pp/SDL.hh b/SDL2pp/SDL.hh index f923da8..cb5edb0 100644 --- a/SDL2pp/SDL.hh +++ b/SDL2pp/SDL.hh @@ -29,7 +29,7 @@ namespace SDL2pp { class SDL { public: SDL(Uint32 flags); - ~SDL(); + virtual ~SDL(); SDL(const SDL& other) = delete; SDL(SDL&& other) = delete; diff --git a/SDL2pp/Texture.hh b/SDL2pp/Texture.hh index acdbea7..9e7410b 100644 --- a/SDL2pp/Texture.hh +++ b/SDL2pp/Texture.hh @@ -38,7 +38,7 @@ private: public: Texture(Renderer& renderer, Uint32 format, int access, int w, int h); - ~Texture(); + virtual ~Texture(); Texture(const Texture& other) = delete; Texture(Texture&& other) = delete; diff --git a/SDL2pp/Window.hh b/SDL2pp/Window.hh index afda315..86ee456 100644 --- a/SDL2pp/Window.hh +++ b/SDL2pp/Window.hh @@ -34,7 +34,7 @@ private: public: Window(const char* title, int x, int y, int w, int h, Uint32 flags); - ~Window(); + virtual ~Window(); Window(const Window& other) = delete; Window(Window&& other) = delete;