[NUI][API11] Fix memory leak when DragAndDrop try to get Position
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 10 Jun 2024 07:21:36 +0000 (16:21 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Mon, 10 Jun 2024 08:00:28 +0000 (17:00 +0900)
Since DragEvent's GetPosition return new Vector2 class internally, we should keep the positoin with memory ownership.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs

index 2d3ae18..c2ad8a3 100755 (executable)
@@ -189,7 +189,7 @@ namespace Tizen.NUI
                 DragType type = (DragType)Interop.DragAndDrop.GetAction(dragEvent);
                 DragEvent ev = new DragEvent();
                 global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(dragEvent);
-                ev.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
+                ev.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true);
 
                 if (type == DragType.Enter)
                 {