From 25064013f36ac50e96e314558da40506d5dacf25 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 18 Jan 2023 15:46:16 +0900 Subject: [PATCH] Assert when proprety notification is used in a thread other than the main thread Change-Id: I9b2f6c1f70327c5289f1e9476d48876d5ecd762b --- dali/internal/event/common/property-notification-impl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dali/internal/event/common/property-notification-impl.cpp b/dali/internal/event/common/property-notification-impl.cpp index 2d87787..6ffecf2 100644 --- a/dali/internal/event/common/property-notification-impl.cpp +++ b/dali/internal/event/common/property-notification-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -122,7 +121,7 @@ PropertyNotification::~PropertyNotification() Disable(); // Guard to disallow use of PropertyNotificationManager after Core has been destroyed - if(Stage::IsInstalled()) + if(!EventThreadServices::IsShuttingDown()) { // Disconnect from the property notification manager mPropertyNotificationManager.PropertyNotificationDestroyed(*this); @@ -149,7 +148,7 @@ void PropertyNotification::Enable() void PropertyNotification::Disable() { // Guard to allow handle destruction after Core has been destroyed - if(Stage::IsInstalled()) + if(!EventThreadServices::IsShuttingDown()) { // Stop scene-graph from monitoring the target's properties. DestroySceneObject(); @@ -227,6 +226,8 @@ void PropertyNotification::DestroySceneObject() { if(mPropertyNotification != nullptr) { + DALI_ASSERT_ALWAYS(EventThreadServices::IsCoreRunning()); + // Remove PropertyNotification using a message to the update manager RemovePropertyNotificationMessage(mUpdateManager, *mPropertyNotification); mPropertyNotification = nullptr; -- 2.7.4