[Tizen] Create another native handle to make sure Registry.Unregister works fine.
authorminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:35:29 +0000 (10:35 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:35:39 +0000 (10:35 +0900)
This reverts commit 0eb29a3d722fd77ddd25ff707b12eb395b763ecc.

Change-Id: I516657073cc7a99a5fe26446da6aacfd88b9782a

src/Tizen.NUI/src/public/BaseHandle.cs

index e0d7ecc..69d904e 100755 (executable)
@@ -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);
         }