Cleaning up the property framework; removal of duplicate methods and incorrect assers
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-notification-impl.cpp
index 713bc7e..510c344 100644 (file)
@@ -30,8 +30,6 @@
 #include <dali/internal/update/common/scene-graph-property-notification.h>
 #include <dali/internal/event/common/thread-local-storage.h>
 
-using namespace std;
-
 using Dali::Internal::SceneGraph::UpdateManager;
 
 namespace Dali
@@ -211,21 +209,23 @@ bool PropertyNotification::CompareSceneObject( const SceneGraph::PropertyNotific
 
 void PropertyNotification::CreateSceneObject()
 {
-  DALI_ASSERT_DEBUG( mPropertyNotification == NULL );
-
-  // Create a new PropertyNotification, temporarily owned
-  SceneGraph::PropertyNotification* propertyNotification = SceneGraph::PropertyNotification::New( *mProxy,
-                                                                                                  mProxyPropertyIndex,
-                                                                                                  mPropertyType,
-                                                                                                  mComponentIndex,
-                                                                                                  GetImplementation(mCondition).type,
-                                                                                                  mRawConditionArgs,
-                                                                                                  mNotifyMode );
-  // Keep a const pointer to the PropertyNotification.
-  mPropertyNotification = propertyNotification;
-
-  // Transfer scene object ownership to the update manager through a message
-  AddPropertyNotificationMessage( mUpdateManager, propertyNotification );
+  // this method can be called from constructor and on stage connection
+  if( !mPropertyNotification )
+  {
+    // Create a new PropertyNotification, temporarily owned
+    SceneGraph::PropertyNotification* propertyNotification = SceneGraph::PropertyNotification::New( *mProxy,
+                                                                                                    mProxyPropertyIndex,
+                                                                                                    mPropertyType,
+                                                                                                    mComponentIndex,
+                                                                                                    GetImplementation(mCondition).type,
+                                                                                                    mRawConditionArgs,
+                                                                                                    mNotifyMode );
+    // Keep a const pointer to the PropertyNotification.
+    mPropertyNotification = propertyNotification;
+
+    // Transfer scene object ownership to the update manager through a message
+    AddPropertyNotificationMessage( mUpdateManager, propertyNotification );
+  }
 }
 
 void PropertyNotification::DestroySceneObject()