From 5bc682ee2438cce6ac7c7d7ef4b76a7b8569e0ef Mon Sep 17 00:00:00 2001 From: SungHyun Min Date: Thu, 27 Oct 2016 10:30:36 +0900 Subject: Modify SerPartContent to remove old content when content is null Signed-off-by: SungHyun Min Change-Id: I668f5702bb9b9418f94fc44de1eab404d23277a6 --- ElmSharp/ElmSharp/ItemObject.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 ElmSharp/ElmSharp/ItemObject.cs (limited to 'ElmSharp') diff --git a/ElmSharp/ElmSharp/ItemObject.cs b/ElmSharp/ElmSharp/ItemObject.cs old mode 100644 new mode 100755 index fb44251..7843ef6 --- a/ElmSharp/ElmSharp/ItemObject.cs +++ b/ElmSharp/ElmSharp/ItemObject.cs @@ -77,9 +77,10 @@ namespace ElmSharp public void SetPartContent(string part, EvasObject content, bool preserveOldContent) { - if (preserveOldContent) + IntPtr oldContent = Interop.Elementary.elm_object_item_part_content_unset(Handle, part); + if (oldContent != IntPtr.Zero && !preserveOldContent) { - Interop.Elementary.elm_object_item_part_content_unset(Handle, part); + Interop.Evas.evas_object_del(oldContent); } Interop.Elementary.elm_object_item_part_content_set(Handle, part, content); _partContents[part ?? "__default__"] = content; -- cgit v1.2.3