From 4222663ab406e0842f71f3a705cc043a5380c1e2 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 21 Feb 2024 21:43:32 +0900 Subject: [PATCH] [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 --- dali/internal/event/common/object-impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } -- 2.7.4