[ElmSharp] Fix RenderPost event remove Handler 32/147332/1
authorSeungkeun Lee <sngn.lee@samsung.com>
Mon, 4 Sep 2017 04:49:59 +0000 (13:49 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Mon, 4 Sep 2017 04:49:59 +0000 (13:49 +0900)
 - evas event callback was not deleted when there is no more handler
 - EventHandler was null when there is no handler
 - So, should use GetInvocationList().Length to check exist of handler

Change-Id: I17bed9a3fea81bae6120c24cae476f33528a9053

src/ElmSharp/ElmSharp/EvasObject.cs

index 9c5b71b..83ace1b 100644 (file)
@@ -216,7 +216,7 @@ namespace ElmSharp
             remove
             {
                 _renderPost -= value;
-                if (_renderPost?.GetInvocationList().Length == 0)
+                if (_renderPost == null)
                 {
                     Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(RealHandle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback);
                     _renderPostCallback = null;