Merge "Add @DEPRECATED to all public symbols of ImageActor & ShaderEffect" into devel...
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / constraint-base.cpp
index 24e41b0..f781543 100644 (file)
@@ -194,25 +194,14 @@ void ConstraintBase::ObjectDestroyed( Object& object )
   DALI_ASSERT_DEBUG( mObservedObjects.End() != iter );
   mObservedObjects.Erase( iter );
 
-  if ( &object != mTargetObject )
-  {
-    // Constraint is not useful anymore as an input-source has been destroyed
-    mSourceDestroyed = true;
-
-    // Stop observing the remaining objects
-    StopObservation();
+  // Constraint is not useful anymore as an input-source has been destroyed
+  mSourceDestroyed = true;
 
-    // Clear our sources as well
-    mSources.clear();
-
-    // We should remove ourselves from the target-object's constraints as well
-    if ( mTargetObject )
-    {
-      mTargetObject->RemoveConstraint( *this );
-    }
-  }
+  // Stop observing the remaining objects
+  StopObservation();
 
-  // NOTE: We do not clear our sources if our target-object is destroyed because we may want to clone this constraint for another target
+  // Clear our sources as well
+  mSources.clear();
 
   // Discard all object & scene-graph pointers
   mSceneGraphConstraint = NULL;