From 9e5cfa0f5f647f404cc9b9edbc77f397a5b8116d Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Wed, 26 Oct 2016 09:29:58 +0900 Subject: [PATCH] Hold added object reference in ItemObject - The lifecycle of added object will same with contained object Change-Id: I01be33a413f5b3706a7828c2b9e5016268931a24 --- src/ElmSharp/ElmSharp/ItemObject.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ElmSharp/ElmSharp/ItemObject.cs b/src/ElmSharp/ElmSharp/ItemObject.cs index a3cc6e2..fb44251 100644 --- a/src/ElmSharp/ElmSharp/ItemObject.cs +++ b/src/ElmSharp/ElmSharp/ItemObject.cs @@ -12,6 +12,7 @@ namespace ElmSharp private static Dictionary s_HandleToItemTable = new Dictionary(); private static int s_globalId = 0; + readonly Dictionary _partContents = new Dictionary(); Interop.Evas.SmartCallback _deleteCallback; IntPtr _handle = IntPtr.Zero; @@ -81,6 +82,7 @@ namespace ElmSharp Interop.Elementary.elm_object_item_part_content_unset(Handle, part); } Interop.Elementary.elm_object_item_part_content_set(Handle, part, content); + _partContents[part ?? "__default__"] = content; } public void SetPartText(string part, string text) @@ -128,6 +130,7 @@ namespace ElmSharp { s_HandleToItemTable.Remove(_handle); } + _partContents.Clear(); _handle = IntPtr.Zero; } -- 2.7.4