[NUI] Fix NUIWidget View thread error message (#1976)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Fri, 4 Sep 2020 02:43:06 +0000 (11:43 +0900)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 02:43:06 +0000 (11:43 +0900)
Register current thread

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
Co-authored-by: dongsug-song <35130733+dongsug-song@users.noreply.github.com>
src/Tizen.NUI/src/public/NUIWidgetApplication.cs

index a34bb89..f473378 100644 (file)
@@ -18,6 +18,7 @@ using Tizen.Applications;
 using Tizen.Applications.CoreBackend;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Threading;
 using System;
 
 namespace Tizen.NUI
@@ -35,6 +36,7 @@ namespace Tizen.NUI
         /// <param name="widgetType">Derived widget class type.</param>
         public NUIWidgetApplication( System.Type widgetType ) : base(new NUIWidgetCoreBackend())
         {
+            Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
             NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
             core?.RegisterWidgetInfo(new Dictionary<System.Type, string> { { widgetType, ApplicationInfo.ApplicationId } });
         }
@@ -51,6 +53,7 @@ namespace Tizen.NUI
             }
             else
             {
+                Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
                 NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
                 core?.RegisterWidgetInfo(widgetTypes);
             }
@@ -65,6 +68,7 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public NUIWidgetApplication(System.Type widgetType, string styleSheet) : base(new NUIWidgetCoreBackend(styleSheet))
         {
+            Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
             NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
             core?.RegisterWidgetInfo(new Dictionary<System.Type, string> { { widgetType, ApplicationInfo.ApplicationId } });
         }