From ccf8f6380c2cac023213351a91765f9735343f97 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 25 Jul 2017 11:02:57 +0900 Subject: [PATCH] [Tizen] Create another native handle to make sure Registry.Unregister works fine. This reverts commit b78b14c77ec08f801290e3a8e92c5908f0423198. Change-Id: Ifb1530802e151b041d4a0f770ef3a37c009f9f71 --- src/Tizen.NUI/src/public/BaseHandle.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); } -- 2.7.4