diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2016-10-13 16:15:16 +0900 |
---|---|---|
committer | Seungkeun Lee <sngn.lee@samsung.com> | 2016-10-18 14:10:56 +0900 |
commit | d414e465977813551ed8ab96ef7f7d359514a3b0 (patch) | |
tree | bf59d826cfdc20969a8614c282afeb9e6fb7c0d3 /ElmSharp/ElmSharp/ItemObject.cs | |
parent | 004f37c49275cc66f4dca01327b587eed35d9237 (diff) | |
download | elm-sharp-d414e465977813551ed8ab96ef7f7d359514a3b0.tar.gz elm-sharp-d414e465977813551ed8ab96ef7f7d359514a3b0.tar.bz2 elm-sharp-d414e465977813551ed8ab96ef7f7d359514a3b0.zip |
Fix GC finalizer issue
- Finalizer was called in GC thread and it can't access EFL object
- Remove all finalizer code that access EFL object
- Hold the reference of EvasObject that was added on Window
- Fix wrong IDispose implemention
- When Dispose(false) native handle should be freed,
but we didn't, it cause seg-fault, after released C# layer, native callback can invoked.
- So, We release native handle when Dispose(false) was called.
- but, it will cause some error message 'Maybe it has already been freed.'
Change-Id: Ic225799ac8cf9fd102a67d870043cb24bad55c7d
Diffstat (limited to 'ElmSharp/ElmSharp/ItemObject.cs')
-rw-r--r-- | ElmSharp/ElmSharp/ItemObject.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ElmSharp/ElmSharp/ItemObject.cs b/ElmSharp/ElmSharp/ItemObject.cs index e8c9be7..a3cc6e2 100644 --- a/ElmSharp/ElmSharp/ItemObject.cs +++ b/ElmSharp/ElmSharp/ItemObject.cs @@ -23,11 +23,14 @@ namespace ElmSharp Handle = handle; } - ~ItemObject() - { - if (Handle != IntPtr.Zero) - Interop.Elementary.elm_object_item_del(Handle); - } + // C# Finalizer was called on GC thread + // So, We can't access to EFL object + // And When Finalizer was called, Field can be already released. + //~ItemObject() + //{ + // if (Handle != IntPtr.Zero) + // Interop.Elementary.elm_object_item_del(Handle); + //} public int Id { get; private set; } |