From 714ecb4250009858fbe1d4d2f83b5d3a67d7f1cf Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Thu, 14 Mar 2024 15:37:46 +0900 Subject: [PATCH] Add some more guard cases before get Adaptor Note that we should allow to get the window list even of adaptor is stopped. That API could be called at OnTerminate cases Change-Id: I8e009aa9f1655ef68b6dfae0a66de0259f5e7bef Signed-off-by: Eunki, Hong --- dali-csharp-binder/common/processor-controller.cpp | 4 ++-- dali-csharp-binder/dali-adaptor/application-wrap.cpp | 4 +++- dali-csharp-binder/dali-adaptor/window-wrap.cpp | 12 +++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dali-csharp-binder/common/processor-controller.cpp b/dali-csharp-binder/common/processor-controller.cpp index 90b7c03a..d4ef8519 100644 --- a/dali-csharp-binder/common/processor-controller.cpp +++ b/dali-csharp-binder/common/processor-controller.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. @@ -44,7 +44,7 @@ ProcessorController::~ProcessorController() { try { - if(mProcessRegistered) + if(mProcessRegistered && Dali::Adaptor::IsAvailable()) { Dali::Adaptor::Get().UnregisterProcessor(*this); Dali::Adaptor::Get().UnregisterProcessor(*this, true); diff --git a/dali-csharp-binder/dali-adaptor/application-wrap.cpp b/dali-csharp-binder/dali-adaptor/application-wrap.cpp index 4b444e4e..8addc5f8 100644 --- a/dali-csharp-binder/dali-adaptor/application-wrap.cpp +++ b/dali-csharp-binder/dali-adaptor/application-wrap.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. @@ -521,6 +521,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_Application_GetWindowsListSize() { try { + // Note : We should not check Dali::Adaptor::IsAvailable() here. Since this API could be called at OnTerminate time. result = Dali::Adaptor::Get().GetWindows(); jresult = result.size(); } @@ -538,6 +539,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Application_GetWindowsFromList(unsigned { try { + // Note : We should not check Dali::Adaptor::IsAvailable() here. Since this API could be called at OnTerminate time. result = Dali::Adaptor::Get().GetWindows(); } CALL_CATCH_EXCEPTION(0); diff --git a/dali-csharp-binder/dali-adaptor/window-wrap.cpp b/dali-csharp-binder/dali-adaptor/window-wrap.cpp index 98543cd2..3ac0a2d5 100644 --- a/dali-csharp-binder/dali-adaptor/window-wrap.cpp +++ b/dali-csharp-binder/dali-adaptor/window-wrap.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. @@ -1564,7 +1564,10 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_FeedKey_Default_Window(void * eve } { try { - Dali::Adaptor::Get().FeedKeyEvent(*keyEvent); + if(Dali::Adaptor::IsAvailable()) + { + Dali::Adaptor::Get().FeedKeyEvent(*keyEvent); + } } CALL_CATCH_EXCEPTION(); } } @@ -1651,7 +1654,10 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_FeedHover(void * window, void * t SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Adaptor_RenderOnce(void * /* jarg1 */) { try { - Dali::Adaptor::Get().RenderOnce(); + if(Dali::Adaptor::IsAvailable()) + { + Dali::Adaptor::Get().RenderOnce(); + } } CALL_CATCH_EXCEPTION(); } -- 2.34.1