Merge remote-tracking branch 'origin/master' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Tue, 3 Jan 2023 10:17:12 +0000 (10:17 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Tue, 3 Jan 2023 10:17:12 +0000 (10:17 +0000)
src/Tizen.NUI/src/internal/Interop/Interop.BaseHandle.cs
src/Tizen.NUI/src/public/Common/BaseHandle.cs

index 749296a..d8d33ca 100755 (executable)
@@ -27,6 +27,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
             public static extern void DeleteBaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
+            public static extern void DeleteBaseHandle(global::System.IntPtr jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_BaseHandle__SWIG_2")]
             public static extern global::System.IntPtr NewBaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index f221e0a..c311d44 100755 (executable)
@@ -568,8 +568,11 @@ namespace Tizen.NUI
             if (swigCPtrCopy.Handle != global::System.IntPtr.Zero)
             {
                 swigCMemOwn = false;
-                Interop.BaseHandle.DeleteBaseHandle(swigCPtrCopy);
+                var nativeSwigCPtr = swigCPtrCopy.Handle;
+
+                // Remove swigCPtrCopy first. Now HasBody() return false.
                 swigCPtrCopy = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                Interop.BaseHandle.DeleteBaseHandle(nativeSwigCPtr);
             }
             else
             {