From 1f5619f7407038c329b1b3326d091447c29265e7 Mon Sep 17 00:00:00 2001 From: John Beard Date: Thu, 16 Feb 2017 09:15:45 +0800 Subject: [PATCH] Add protected virtual dtor for GAL_DISPLAY_OPTIONS_OBSERVER GAL_DISPLAY_OPTIONS_OBSERVER aren't deleted by a base class pointer - they are an "incidental" part of other classes. Add a virtual protected destructor to make this explicit. --- include/gal/gal_display_options.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index 1c505a06fd..f03a3427ad 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -55,6 +55,9 @@ namespace KIGFX { public: virtual void OnGalDisplayOptionsChanged( const GAL_DISPLAY_OPTIONS& ) = 0; + protected: + // Observer lifetimes aren't handled by base class pointer + virtual ~GAL_DISPLAY_OPTIONS_OBSERVER() {} }; class GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE