cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f4527c72833f348fca875ef5ff70cf8aa6146f56

commit f4527c72833f348fca875ef5ff70cf8aa6146f56
Author: Cedric Bail <ced...@osg.samsung.com>
Date:   Wed Nov 23 17:54:50 2016 -0800

    eo: when there is no more callbacks, let's clean up.
---
 src/lib/eo/eo_base_class.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 352cb8b..b6b486c 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1005,6 +1005,12 @@ _eo_callback_remove(Efl_Object_Data *pd, 
Eo_Callback_Description **cb)
    length = pd->callbacks_count - (cb - pd->callbacks);
    if (length > 1) memmove(cb, cb + 1, (length - 1) * sizeof 
(Eo_Callback_Description*));
    pd->callbacks_count--;
+
+   if (pd->callbacks_count == 0)
+     {
+        free(pd->callbacks);
+        pd->callbacks = NULL;
+     }
 }
 
 /* Actually remove, doesn't care about walking list, or delete_me */

-- 


Reply via email to