From fe8153f8ff088258cc6d8d2b7a2d6b21a9bd843b 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 8621b53..5ad4a43 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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. @@ -284,6 +284,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); @@ -386,7 +387,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