[NUI] Workaround of Vulkan backend csfs crash issue (#630)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 24 Dec 2018 05:05:05 +0000 (14:05 +0900)
committerGitHub <noreply@github.com>
Mon, 24 Dec 2018 05:05:05 +0000 (14:05 +0900)
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/internal/VersionCheck.cs
src/Tizen.NUI/src/public/NUIApplication.cs

index 8e47d7d..d4b8be5 100755 (executable)
@@ -205,6 +205,29 @@ namespace Tizen.NUI
                                           argumentNullDelegate,
                                           argumentOutOfRangeDelegate);
             }
+
+            //Workaround for Vulkan. should be removed.
+            internal void SetAgain()
+            {
+                SWIGRegisterExceptionCallbacks_NDalic(
+                          applicationDelegate,
+                          arithmeticDelegate,
+                          divideByZeroDelegate,
+                          indexOutOfRangeDelegate,
+                          invalidCastDelegate,
+                          invalidOperationDelegate,
+                          ioDelegate,
+                          nullReferenceDelegate,
+                          outOfMemoryDelegate,
+                          overflowDelegate,
+                          systemDelegate);
+
+                SWIGRegisterExceptionCallbacksArgument_NDalic(
+                                          argumentDelegate,
+                                          argumentNullDelegate,
+                                          argumentOutOfRangeDelegate);
+            }
+
         }
 
         protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
@@ -296,10 +319,24 @@ namespace Tizen.NUI
             {
                 SWIGRegisterStringCallback_NDalic(stringDelegate);
             }
+
+            //Workaround for Vulkan. should be removed.
+            internal void SetAgain()
+            {
+                SWIGRegisterStringCallback_NDalic(stringDelegate);
+            }
         }
 
         static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
 
+        //Workaround for Vulkan. should be removed.
+        internal static void SetAgainExceptionHelperAndStringHelper()
+        {
+            swigExceptionHelper.SetAgain();
+            swigStringHelper.SetAgain();
+            Tizen.Log.Error("NUI", $"[NOT ERROR] SetAgainExceptionHelperAndStringHelper()");
+        }
+
 
         static NDalicPINVOKE()
         {
index cc597b5..5326936 100755 (executable)
@@ -65,7 +65,7 @@ namespace Tizen.NUI
         }
 
         //[Conditional("DEBUG_ON")]
-        static private void PrintDaliNativeVersion()
+        static internal void PrintDaliNativeVersion()
         {
             int ver1 = -1;
             int ver2 = -1;
index 2575bf9..02bc138 100755 (executable)
@@ -147,6 +147,14 @@ namespace Tizen.NUI
             if (windowSize != null) { _windowSize2D = windowSize; }
             if (windowPosition != null) { _windowPosition2D = windowPosition; }
             Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
+
+            //Workaround for Vulkan. should be removed.
+            if (Graphics.Backend == Graphics.BackendType.Vulkan)
+            {
+                Tizen.Log.Error("NUI", "[NOT ERROR] NUIApplication Constructor! Vulkan backend!");
+                Version.PrintDaliNativeVersion();
+                NDalicPINVOKE.SetAgainExceptionHelperAndStringHelper();
+            }
         }
 
         /// <summary>