From: Kimmo Hoikka Date: Wed, 17 May 2017 14:03:50 +0000 (+0100) Subject: Enable -Wnon-virtual-dtor to avoid incorrect C++ code sneaking in X-Git-Tag: dali_1.2.40~4^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=418d4f93f7158ef267ab389106f831033671c880 Enable -Wnon-virtual-dtor to avoid incorrect C++ code sneaking in Change-Id: Ic70f3e0c688ca3f6ea191842ae0f7f4271330b19 --- diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac index 45e7fc5..b379480 100644 --- a/build/tizen/configure.ac +++ b/build/tizen/configure.ac @@ -31,7 +31,7 @@ AC_SUBST(DALI_VERSION) DALI_CFLAGS=-DPLATFORM_TIZEN # Use C++ 11 -DALI_CFLAGS="$DALI_CFLAGS -std=c++11" +DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor" AC_ARG_ENABLE(exportall, [AC_HELP_STRING([--enable-exportall], diff --git a/dali/integration-api/bitmap.h b/dali/integration-api/bitmap.h index 01b3b4c..1e1b9bc 100644 --- a/dali/integration-api/bitmap.h +++ b/dali/integration-api/bitmap.h @@ -267,6 +267,13 @@ public: * This property can then be tested for with IsFullyOpaque(). */ virtual void TestForTransparency() = 0; + + protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~PackedPixelsProfile() {} }; /** @@ -304,6 +311,12 @@ public: const unsigned width, const unsigned height, const size_t numBytes ) = 0; + protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~CompressedProfile() {} }; virtual const CompressedProfile* GetCompressedProfile() const { return 0; } @@ -331,6 +344,8 @@ public: */ void DeletePixelBuffer(); +protected: + /** * A reference counted object may only be deleted by calling Unreference() */ diff --git a/dali/integration-api/context-notifier.h b/dali/integration-api/context-notifier.h index 348f292..86cbc6d 100644 --- a/dali/integration-api/context-notifier.h +++ b/dali/integration-api/context-notifier.h @@ -46,6 +46,14 @@ public: * Multi-threading note: this method should be called from the main thread */ virtual void NotifyContextRegained() = 0; + +protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~ContextNotifierInterface() {} + }; } // namespace Integration diff --git a/dali/integration-api/gesture-manager.h b/dali/integration-api/gesture-manager.h index ba32f03..c86db4a 100644 --- a/dali/integration-api/gesture-manager.h +++ b/dali/integration-api/gesture-manager.h @@ -57,6 +57,13 @@ public: */ virtual void Update(const GestureRequest& request) = 0; +protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~GestureManager() {} + }; // class GestureManager } // namespace Integration diff --git a/dali/internal/event/events/hit-test-algorithm-impl.cpp b/dali/internal/event/events/hit-test-algorithm-impl.cpp index d90e213..56027a0 100644 --- a/dali/internal/event/events/hit-test-algorithm-impl.cpp +++ b/dali/internal/event/events/hit-test-algorithm-impl.cpp @@ -601,6 +601,10 @@ bool HitTestForEachRenderTask( Stage& stage, } // unnamed namespace +HitTestInterface::~HitTestInterface() +{ +} + bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func ) { bool wasHit( false ); diff --git a/dali/internal/event/events/hit-test-algorithm-impl.h b/dali/internal/event/events/hit-test-algorithm-impl.h index c0b68e3..bfe9cb0 100644 --- a/dali/internal/event/events/hit-test-algorithm-impl.h +++ b/dali/internal/event/events/hit-test-algorithm-impl.h @@ -81,6 +81,14 @@ struct HitTestInterface * @return true if the layer should consume the hit, false otherwise. */ virtual bool DoesLayerConsumeHit( Layer* layer ) = 0; + +protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~HitTestInterface(); + }; /** diff --git a/dali/internal/update/common/property-owner.h b/dali/internal/update/common/property-owner.h index 3df069b..fa7bf46 100644 --- a/dali/internal/update/common/property-owner.h +++ b/dali/internal/update/common/property-owner.h @@ -76,6 +76,14 @@ public: * may not be called (i.e. when shutting down). */ virtual void PropertyOwnerDestroyed( PropertyOwner& owner ) = 0; + + protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~Observer() {} + }; /** diff --git a/dali/internal/update/common/scene-graph-connection-change-propagator.h b/dali/internal/update/common/scene-graph-connection-change-propagator.h index 65e49fc..91b1a04 100644 --- a/dali/internal/update/common/scene-graph-connection-change-propagator.h +++ b/dali/internal/update/common/scene-graph-connection-change-propagator.h @@ -53,6 +53,14 @@ public: * Inform the observer of the object that the object is about to be destroyed */ virtual void ObservedObjectDestroyed(PropertyOwner& object){} + + protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~Observer() {} + }; /** diff --git a/dali/internal/update/common/uniform-map.h b/dali/internal/update/common/uniform-map.h index d34c014..9b5bb4c 100644 --- a/dali/internal/update/common/uniform-map.h +++ b/dali/internal/update/common/uniform-map.h @@ -74,7 +74,19 @@ public: class Observer { public: + + /** + * Inform observer that uniform mappings have been changed + * @param mappings + */ virtual void UniformMappingsChanged(const UniformMap& mappings) = 0; + + protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~Observer() {} }; /**