From f2c3d701dc93b6cd85cb0e7539c6ae83f362f13f Mon Sep 17 00:00:00 2001 From: Paul Wisbey Date: Sat, 18 Apr 2015 14:48:55 +0100 Subject: [PATCH] Constraint sources may be destroyed before Constraint::Apply() Change-Id: I85fbd2cc4f1d7aa3e70888d0130f9ed4dcbf5a65 --- dali/internal/event/common/object-impl.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index e63c857..fb8a26a 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -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 ); + } } } -- 2.7.4