From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Tue, 30 Jan 2018 00:05:53 +0000 (+0900) Subject: [NUI] fix Parent property memory leak (#100) X-Git-Tag: 4.0.1-preview1-00070~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5425ff62bfb2de90b882a00eb6936575253f6bf3;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] fix Parent property memory leak (#100) --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 15d421f..7655247 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -4328,11 +4328,8 @@ namespace Tizen.NUI.BaseComponents { View ret; IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - //HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - //BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); - //NDalicPINVOKE.delete_BaseHandle(CPtr); - //CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); if (basehandle is Layer) { @@ -4343,6 +4340,9 @@ namespace Tizen.NUI.BaseComponents ret = basehandle as View; } + NDalicPINVOKE.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;