Constraint sources may be destroyed before Constraint::Apply() 70/38370/1
authorPaul Wisbey <p.wisbey@samsung.com>
Sat, 18 Apr 2015 13:48:55 +0000 (14:48 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Sat, 18 Apr 2015 13:48:55 +0000 (14:48 +0100)
Change-Id: I85fbd2cc4f1d7aa3e70888d0130f9ed4dcbf5a65

dali/internal/event/common/object-impl.cpp

index e63c857..fb8a26a 100644 (file)
@@ -1001,12 +1001,14 @@ void Object::ApplyConstraint( ConstraintBase& constraint )
 
 void Object::RemoveConstraint( ConstraintBase& constraint )
 {
-  DALI_ASSERT_DEBUG( mConstraints );
-
-  ConstraintIter it( std::find( mConstraints->begin(), mConstraints->end(), Dali::Constraint( &constraint ) ) );
-  if( it != mConstraints->end() )
+  // NULL if the Constraint sources are destroyed before Constraint::Apply()
+  if( mConstraints )
   {
-    mConstraints->erase( it );
+    ConstraintIter it( std::find( mConstraints->begin(), mConstraints->end(), Dali::Constraint( &constraint ) ) );
+    if( it != mConstraints->end() )
+    {
+      mConstraints->erase( it );
+    }
   }
 }