From: Eunki, Hong Date: Thu, 14 Mar 2024 06:37:46 +0000 (+0900) Subject: Add some more guard cases before get Adaptor X-Git-Tag: dali_2.3.16~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=714ecb4250009858fbe1d4d2f83b5d3a67d7f1cf;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git 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 --- diff --git a/dali-csharp-binder/common/processor-controller.cpp b/dali-csharp-binder/common/processor-controller.cpp index 90b7c03..d4ef851 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 4b444e4..8addc5f 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 98543cd..3ac0a2d 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(); }