Change Internal::Control destructor to protected 20/100020/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 24 Nov 2016 17:43:40 +0000 (17:43 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 24 Nov 2016 17:43:42 +0000 (17:43 +0000)
This is a ref-counted object so another object should not be able to delete it.

Change-Id: I05d2d262f509380586584acfa1fb6646fe1ba688

dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h

index b8d59eb..2bc13be 100644 (file)
@@ -542,11 +542,6 @@ Toolkit::Control Control::New()
   return handle;
 }
 
-Control::~Control()
-{
-  delete mImpl;
-}
-
 void Control::SetStyleName( const std::string& styleName )
 {
   if( styleName != mImpl->mStyleName )
@@ -994,6 +989,11 @@ Control::Control( ControlBehaviour behaviourFlags )
   mImpl->mFlags = behaviourFlags;
 }
 
+Control::~Control()
+{
+  delete mImpl;
+}
+
 void Control::Initialize()
 {
   // Call deriving classes so initialised before styling is applied to them.
index 9993237..95ea152 100644 (file)
@@ -76,12 +76,6 @@ public:
    */
   static Toolkit::Control New();
 
-  /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
-   */
-  virtual ~Control();
-
   // Styling
 
   /**
@@ -520,6 +514,12 @@ protected: // Helpers for deriving classes
   Control( ControlBehaviour behaviourFlags );
 
   /**
+   * @brief Virtual destructor.
+   * @SINCE_1_0.0
+   */
+  virtual ~Control();
+
+  /**
    * @brief Second phase initialization.
    * @SINCE_1_0.0
    */