[NUI] Fix TCT Crash issue, Parent crash 93/168993/1
authorhuiyu,eun <huiyu.eun@samsung.com>
Thu, 1 Feb 2018 13:58:26 +0000 (22:58 +0900)
committerhuiyu,eun <huiyu.eun@samsung.com>
Thu, 1 Feb 2018 13:58:26 +0000 (22:58 +0900)
Change-Id: I60b03f0b92abd4e0c80abd755d94f2d846241948
Signed-off-by: huiyu,eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs

index 7655247..4b3f3d8 100755 (executable)
@@ -1196,10 +1196,9 @@ namespace Tizen.NUI.BaseComponents
         private View ConvertIdToView(uint id)
         {
             View view = null;
-
-            if (Parent is View)
+            if (GetParent() is View)
             {
-                View parentView = Parent as View;
+                View parentView = GetParent() as View;
                 view = parentView.FindChildById(id);
             }
 
@@ -4334,14 +4333,15 @@ namespace Tizen.NUI.BaseComponents
                 if (basehandle is Layer)
                 {
                     ret = new View(cPtr, false);
+                    NUILog.Error("This Parent property is deprecated, shoud do not be used");
                 }
                 else
                 {
                     ret = basehandle as View;
+                    NDalicPINVOKE.delete_BaseHandle(CPtr);
+                    CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
                 }
 
-                NDalicPINVOKE.delete_BaseHandle(CPtr);
-                CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
 
                 if (NDalicPINVOKE.SWIGPendingException.Pending)
                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();