X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fcommon%2Fproperty-owner.cpp;h=aa666efd4aab678588f28b385ef16fb786d37103;hb=e2ee93d144c63abb914c086281d09c40b213919f;hp=ec3d17a95d532162945ad566b68f6353996bc62e;hpb=7882128f66bc91dbca9573caddd312115be440c4;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/common/property-owner.cpp b/dali/internal/update/common/property-owner.cpp index ec3d17a..aa666ef 100644 --- a/dali/internal/update/common/property-owner.cpp +++ b/dali/internal/update/common/property-owner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,11 +110,9 @@ void PropertyOwner::DisconnectFromSceneGraph( BufferIndex updateBufferIndex ) mConstraints.Clear(); } -void PropertyOwner::InstallCustomProperty(PropertyBase* property) +void PropertyOwner::InstallCustomProperty( OwnerPointer& property ) { - DALI_ASSERT_DEBUG( NULL != property ); - - mCustomProperties.PushBack( property ); + mCustomProperties.PushBack( property.Release() ); } void PropertyOwner::ResetToBaseValues( BufferIndex updateBufferIndex ) @@ -135,11 +133,10 @@ ConstraintOwnerContainer& PropertyOwner::GetConstraints() return mConstraints; } -void PropertyOwner::ApplyConstraint( ConstraintBase* constraint ) +void PropertyOwner::ApplyConstraint( OwnerPointer& constraint ) { - mConstraints.PushBack( constraint ); - constraint->OnConnect(); + mConstraints.PushBack( constraint.Release() ); } void PropertyOwner::RemoveConstraint( ConstraintBase* constraint ) @@ -154,17 +151,16 @@ void PropertyOwner::RemoveConstraint( ConstraintBase* constraint ) } } - // Should not come here - DALI_ASSERT_DEBUG( false && "Constraint missing in RemoveConstraint" ); + //it may be that the constraint has already been removed e.g. from disconnection from scene graph, so nothing needs to be done } PropertyOwner::PropertyOwner() { } -void PropertyOwner::AddUniformMapping( UniformPropertyMapping* map ) +void PropertyOwner::AddUniformMapping( OwnerPointer< UniformPropertyMapping >& map ) { - mUniformMaps.Add( map ); + mUniformMaps.Add( map.Release() ); } void PropertyOwner::RemoveUniformMapping( const std::string& uniformName )