From: minho.sun Date: Mon, 14 Aug 2017 08:10:38 +0000 (+0900) Subject: [Tizen] Create another native handle to make sure Registry.Unregister works fine. X-Git-Tag: preview1-00180^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32d5dc41838d15310a51f865fc2cff9a41158e63;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tizen] Create another native handle to make sure Registry.Unregister works fine. This reverts commit a09d830e35905c0e9809c2f34accc1b7b20af1b8. Change-Id: I10ae1e56d487d295f8a09f252f7b29083bf974bb --- diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index e0d7ecc..69d904e 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -43,6 +43,18 @@ namespace Tizen.NUI _registerMe = swigCMemOwn = true; 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); }