[NUI] Remove throw exception for WidgetView, Enable NameScopeExtensions.FindByName...
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 10 May 2019 06:39:15 +0000 (15:39 +0900)
committerGitHub <noreply@github.com>
Fri, 10 May 2019 06:39:15 +0000 (15:39 +0900)
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
src/Tizen.NUI/src/internal/Registry.cs
src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs
src/Tizen.NUI/src/public/Layer.cs

index 7e33d039e35f0183b9eb9a99c45e1c6883173379..c4e743a04e3e4457c0838dba58f2a572c9b2ab3f 100755 (executable)
@@ -159,7 +159,8 @@ namespace Tizen.NUI
             if (savedApplicationThread == null)
             {
                 Tizen.Log.Fatal("NUI", $"Error! maybe main thread is created by other process\n");
-                throw new global::System.ApplicationException("Error! maybe main thread is created by other process");
+                return;
+                //throw new global::System.ApplicationException("Error! maybe main thread is created by other process");
             }
             int currentId = Thread.CurrentThread.ManagedThreadId;
             int mainThreadId = savedApplicationThread.ManagedThreadId;
index 912886eeab2ba8619074f8b8de2e857be5445a56..e486e973f996f7d3d2d2f89d0f46ca7f6a080a6f 100755 (executable)
@@ -138,6 +138,11 @@ namespace Tizen.NUI.Xaml
                         continue;
                     }
 
+                    if (view is Element)
+                    {
+                        (view as Element).IsCreateByXaml = true;
+                    }
+
                     var rootnode = new RuntimeRootNode (new XmlType (reader.NamespaceURI, reader.Name, null), view, (IXmlNamespaceResolver)reader);
                     XamlParser.ParseXaml (rootnode, reader);
                     Visit (rootnode, new HydrationContext {
index 63345a04fdedc45fd27bb2a5be4865cc82817d3c..3a21ad45cf2e29b967a03a2e3cd003be26f355a8 100755 (executable)
@@ -381,6 +381,22 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public View FindChildByName(string viewName)
+        {
+            //to fix memory leak issue, match the handle count with native side.
+            IntPtr cPtr = Interop.Actor.Actor_FindChildByName(swigCPtr, viewName);
+            HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+            Interop.BaseHandle.delete_BaseHandle(CPtr);
+            CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         /// <summary>
         /// Increments the depth of the layer.
         /// </summary>