From 1fd4bbf4e437b145aa423fbce1d71b0590e607cf Mon Sep 17 00:00:00 2001 From: "jonghyun.ho" Date: Sat, 31 May 2014 11:05:16 +0900 Subject: [PATCH] Guard against constraint sending messages during core destruction [cause] ProxyObject was about to send a message after core is already destroyed. [solution] Guard against constraint sending messages during core destruction --- dali/internal/event/common/proxy-object.cpp | 43 +++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/dali/internal/event/common/proxy-object.cpp b/dali/internal/event/common/proxy-object.cpp index 7a65d44..1d308ee 100644 --- a/dali/internal/event/common/proxy-object.cpp +++ b/dali/internal/event/common/proxy-object.cpp @@ -907,31 +907,35 @@ TypeInfo* ProxyObject::GetTypeInfo() const void ProxyObject::RemoveConstraint( ActiveConstraint& constraint, bool isInScenegraph ) { - if( isInScenegraph ) + // guard against constraint sending messages during core destruction + if ( Stage::IsInstalled() ) { - ActiveConstraintBase& baseConstraint = GetImplementation( constraint ); - baseConstraint.BeginRemove(); - if ( baseConstraint.IsRemoving() ) + if( isInScenegraph ) { - if( !mRemovedConstraints ) + ActiveConstraintBase& baseConstraint = GetImplementation( constraint ); + baseConstraint.BeginRemove(); + if ( baseConstraint.IsRemoving() ) { - mRemovedConstraints = new ActiveConstraintContainer; + if( !mRemovedConstraints ) + { + mRemovedConstraints = new ActiveConstraintContainer; + } + // Wait for remove animation before destroying active-constraints + mRemovedConstraints->push_back( constraint ); } - // Wait for remove animation before destroying active-constraints - mRemovedConstraints->push_back( constraint ); } - } - else if( mRemovedConstraints ) - { - delete mRemovedConstraints; - mRemovedConstraints = NULL; + else if( mRemovedConstraints ) + { + delete mRemovedConstraints; + mRemovedConstraints = NULL; + } } } - void ProxyObject::RemoveConstraint( Dali::ActiveConstraint activeConstraint ) { - if( mConstraints ) + // guard against constraint sending messages during core destruction + if( mConstraints && Stage::IsInstalled() ) { bool isInSceneGraph( NULL != GetSceneObject() ); if( isInSceneGraph ) @@ -946,14 +950,12 @@ void ProxyObject::RemoveConstraint( Dali::ActiveConstraint activeConstraint ) mConstraints->erase( it ); } } - } - - void ProxyObject::RemoveConstraints( unsigned int tag ) { - if( mConstraints ) + // guard against constraint sending messages during core destruction + if( mConstraints && Stage::IsInstalled() ) { bool isInSceneGraph( NULL != GetSceneObject() ); if( isInSceneGraph ) @@ -980,7 +982,8 @@ void ProxyObject::RemoveConstraints( unsigned int tag ) void ProxyObject::RemoveConstraints() { - if( mConstraints ) + // guard against constraint sending messages during core destruction + if( mConstraints && Stage::IsInstalled() ) { // If we have nothing in the scene-graph, just clear constraint containers const SceneGraph::PropertyOwner* propertyOwner = GetSceneObject(); -- 2.7.4