Enable -Wnon-virtual-dtor to avoid incorrect C++ code sneaking in 88/129688/3
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 17 May 2017 14:03:50 +0000 (15:03 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 17 May 2017 15:44:40 +0000 (16:44 +0100)
Change-Id: Ic70f3e0c688ca3f6ea191842ae0f7f4271330b19

build/tizen/configure.ac
dali/integration-api/bitmap.h
dali/integration-api/context-notifier.h
dali/integration-api/gesture-manager.h
dali/internal/event/events/hit-test-algorithm-impl.cpp
dali/internal/event/events/hit-test-algorithm-impl.h
dali/internal/update/common/property-owner.h
dali/internal/update/common/scene-graph-connection-change-propagator.h
dali/internal/update/common/uniform-map.h

index 45e7fc5..b379480 100644 (file)
@@ -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],
index 01b3b4c..1e1b9bc 100644 (file)
@@ -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()
    */
index 348f292..86cbc6d 100644 (file)
@@ -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
index ba32f03..c86db4a 100644 (file)
@@ -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
index d90e213..56027a0 100644 (file)
@@ -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 );
index c0b68e3..bfe9cb0 100644 (file)
@@ -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();
+
 };
 
 /**
index 3df069b..fa7bf46 100644 (file)
@@ -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() {}
+
   };
 
   /**
index 65e49fc..91b1a04 100644 (file)
@@ -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() {}
+
   };
 
   /**
index d34c014..9b5bb4c 100644 (file)
@@ -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() {}
   };
 
   /**