diff options
author | Cedric Bail <cedric@osg.samsung.com> | 2016-11-23 17:54:50 -0800 |
---|---|---|
committer | Cedric Bail <cedric@osg.samsung.com> | 2016-11-23 18:50:19 -0800 |
commit | f4527c72833f348fca875ef5ff70cf8aa6146f56 (patch) | |
tree | 30e82e996732cb6e56e59d6b5fdfcfd1d4e98583 | |
parent | b5fedfad7e7f5b569388a43df5adc5d6cd197bce (diff) | |
download | efl-f4527c72833f348fca875ef5ff70cf8aa6146f56.tar.gz |
eo: when there is no more callbacks, let's clean up.
-rw-r--r-- | src/lib/eo/eo_base_class.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 352cb8bb74..b6b486c935 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 */ |