[Tizen] Add some more guard cases before get Adaptor 16/307916/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 14 Mar 2024 06:37:46 +0000 (15:37 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 15 Mar 2024 08:13:04 +0000 (17:13 +0900)
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 <eunkiki.hong@samsung.com>
dali-csharp-binder/common/processor-controller.cpp
dali-csharp-binder/dali-adaptor/application-wrap.cpp
dali-csharp-binder/dali-adaptor/window-wrap.cpp

index 90b7c03..d4ef851 100644 (file)
@@ -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);
index 217eb02..574a018 100644 (file)
@@ -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.
@@ -525,6 +525,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();
     }
@@ -542,6 +543,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);
index 0e7ac82..f89c5e0 100644 (file)
@@ -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.
@@ -1725,7 +1725,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();
   }
 }
@@ -1812,7 +1815,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();
 }