eo: when there is no more callbacks, let's clean up.

This commit is contained in:
Cedric Bail 2016-11-23 17:54:50 -08:00
parent b5fedfad7e
commit f4527c7283
1 changed files with 6 additions and 0 deletions

View File

@ -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 */