From: Seungkeun Lee Date: Wed, 26 Oct 2016 00:29:58 +0000 (+0900) Subject: Hold added object reference in ItemObject X-Git-Tag: submit/trunk/20170823.075128~110^2~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=9e5cfa0f5f647f404cc9b9edbc77f397a5b8116d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Hold added object reference in ItemObject - The lifecycle of added object will same with contained object Change-Id: I01be33a413f5b3706a7828c2b9e5016268931a24 --- 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; }