From: Eunki, Hong Date: Wed, 21 Feb 2024 12:43:32 +0000 (+0900) Subject: [Tizen] Safety guard for BaseObject during SetProperty X-Git-Tag: accepted/tizen/8.0/unified/20240301.174436~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4222663ab406e0842f71f3a705cc043a5380c1e2;p=platform%2Fcore%2Fuifw%2Fdali-core.git [Tizen] Safety guard for BaseObject during SetProperty It is possible to delete self during SetProperty. To avoid this case, let we keep the handle during SetProperty / OnSetProperty / PropertySetSignal emit. TODO : Is SetProperty is the only case to be break down? Change-Id: I7cb8249958914105a2cb8e8e3a44545f23948516 Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index 590acbc..8859047 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -286,6 +286,7 @@ Property::Type Object::GetPropertyType(Property::Index index) const void Object::SetProperty(Property::Index index, Property::Value propertyValue) { DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds"); + Dali::Handle handle(this); bool propertySet(true); @@ -388,7 +389,6 @@ void Object::SetProperty(Property::Index index, Property::Value propertyValue) OnPropertySet(index, propertyValue); if(!mPropertySetSignal.Empty()) { - Dali::Handle handle(this); mPropertySetSignal.Emit(handle, index, propertyValue); } }