summaryrefslogtreecommitdiff
path: root/ElmSharp/ElmSharp/ItemObject.cs
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2016-09-27 07:57:52 +0900
committerSeungkeun Lee <sngn.lee@samsung.com>2016-09-27 08:28:39 +0900
commitceab438952d5ca5308f16a54a1df16e86a0d94b6 (patch)
treef3f8db66737a4a789172a812a6283968b7be5a6a /ElmSharp/ElmSharp/ItemObject.cs
parent42cdba6d5dc8b8eb52f5626811805aa1dca62ab4 (diff)
downloadelm-sharp-ceab438952d5ca5308f16a54a1df16e86a0d94b6.tar.gz
elm-sharp-ceab438952d5ca5308f16a54a1df16e86a0d94b6.tar.bz2
elm-sharp-ceab438952d5ca5308f16a54a1df16e86a0d94b6.zip
Fix callback order issue, memory leak issue in GenItem,GenItemClass
- GenItemClass::DeleteHandler was called, after related item was cleanup So, developer can't access to related item in DeleteHandler. I change the source of DeleteHandler - Memory leak on ItemObject s_IdToItemTable and s_HandleToItemTable was not removed when Item was deleted, So ItemObject can't released. Change-Id: Ibe5ada852f1c1d777ece5667b3aafa5be4cf119d
Diffstat (limited to 'ElmSharp/ElmSharp/ItemObject.cs')
-rw-r--r--ElmSharp/ElmSharp/ItemObject.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ElmSharp/ElmSharp/ItemObject.cs b/ElmSharp/ElmSharp/ItemObject.cs
index 65f28dc..e8c9be7 100644
--- a/ElmSharp/ElmSharp/ItemObject.cs
+++ b/ElmSharp/ElmSharp/ItemObject.cs
@@ -117,6 +117,14 @@ namespace ElmSharp
{
Deleted?.Invoke(this, EventArgs.Empty);
OnInvalidate();
+ if (s_IdToItemTable.ContainsKey(Id))
+ {
+ s_IdToItemTable.Remove(Id);
+ }
+ if (s_HandleToItemTable.ContainsKey(_handle))
+ {
+ s_HandleToItemTable.Remove(_handle);
+ }
_handle = IntPtr.Zero;
}