From 3cbdc7f681ec3bc5a32501b10d11e9d47ca38980 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 23 Jan 2024 12:42:36 +0900 Subject: [PATCH] Call idle functions what we might be failed to add Since AddIdle could be failed at ecore side, we need to call given callback synchronously, or need to print some error logs for some cases Change-Id: Iea7268071c47e998b66a57154d81aead866d5db2 Signed-off-by: Eunki, Hong --- dali/internal/accessibility/bridge/bridge-impl.cpp | 10 +++++++--- dali/internal/legacy/common/tizen-platform-abstraction.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dali/internal/accessibility/bridge/bridge-impl.cpp b/dali/internal/accessibility/bridge/bridge-impl.cpp index 2ebc048..3851cbc 100644 --- a/dali/internal/accessibility/bridge/bridge-impl.cpp +++ b/dali/internal/accessibility/bridge/bridge-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. @@ -39,8 +39,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -776,7 +776,11 @@ public: if(NULL == mIdleCallback) { mIdleCallback = MakeCallback(this, &BridgeImpl::OnIdleSignal); - adaptor.AddIdle(mIdleCallback, true); + if(DALI_UNLIKELY(!adaptor.AddIdle(mIdleCallback, true))) + { + DALI_LOG_ERROR("Fail to add idle callback for bridge initialize. Call it synchronously.\n"); + OnIdleSignal(); + } } } } diff --git a/dali/internal/legacy/common/tizen-platform-abstraction.cpp b/dali/internal/legacy/common/tizen-platform-abstraction.cpp index 30748d8..220ac82 100644 --- a/dali/internal/legacy/common/tizen-platform-abstraction.cpp +++ b/dali/internal/legacy/common/tizen-platform-abstraction.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. @@ -234,7 +234,11 @@ void TizenPlatformAbstraction::RunTimerFunction(TimerCallback& timerPtr) mTimerPairsWaiting.erase(timerIter, timerIter + 1); - Dali::Adaptor::Get().AddIdle(MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers), false); + if(DALI_UNLIKELY(!Dali::Adaptor::Get().AddIdle(MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers), false))) + { + DALI_LOG_ERROR("Fail to add idle callback for timer function. Call it synchronously.\n"); + CleanupTimers(); + } } void TizenPlatformAbstraction::CleanupTimers() -- 2.7.4