From: dongsug.song Date: Tue, 25 Jul 2017 01:39:24 +0000 (+0900) Subject: Revert "[Tizen] Create another native handle to make sure Registry.Unregister works... X-Git-Tag: preview1-00180^2~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a193a2b8146834686297ab308464ab054bec092;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Revert "[Tizen] Create another native handle to make sure Registry.Unregister works fine." This reverts commit 3b83e387f4e051a198f1e4417f2b33ab592fdb1b. Change-Id: I777fe5c8ecdf1781d9c95c845a4cfe7dd7f7afcd --- diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index d14f943..8ac41e0 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -27,18 +27,6 @@ namespace Tizen.NUI swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - // using copy constructor to create another native handle so Registry.Unregister works fine. - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr)); - - // Register this instance of BaseHandle in the registry. - Registry.Register(this); - } - - internal BaseHandle(global::System.IntPtr cPtr) - { - swigCMemOwn = true; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - // Register this instance of BaseHandle in the registry. Registry.Register(this); } @@ -105,8 +93,11 @@ namespace Tizen.NUI if (swigCPtr.Handle != global::System.IntPtr.Zero) { - swigCMemOwn = false; - NDalicPINVOKE.delete_BaseHandle(swigCPtr); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_BaseHandle(swigCPtr); + } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } @@ -237,12 +228,12 @@ namespace Tizen.NUI } - public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1()) + public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle))) + public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }