efl_ui_collection: do not leak

this fixes leaking of membership to a pan object, additionally this also
fixes the leaking of the pan object. This code was written with the
thought that edje deletes its children, long story short: no it does
not. While fixing the leak of the pan object, the error was found that
the membership of the item to the pan object was leaked, which ended up
in the item beeing deleted, even if its not part of the object anymore.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10841
This commit is contained in:
Marcel Hollerbach 2019-12-09 18:42:02 +01:00 committed by Cedric BAIL
parent e81dc6a02b
commit eaf2a8d7ec
1 changed files with 3 additions and 0 deletions

View File

@ -438,6 +438,8 @@ _efl_ui_collection_efl_object_invalidate(Eo *obj, Efl_Ui_Collection_Data *pd EIN
while(pd->items)
efl_del(pd->items->data);
efl_del(pd->pan);
efl_invalidate(efl_super(obj, MY_CLASS));
}
@ -704,6 +706,7 @@ unregister_item(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item)
efl_event_callback_array_del(item, active_item(), obj);
efl_ui_position_manager_entity_item_removed(pd->pos_man, id, item);
efl_ui_item_container_set(item, NULL);
efl_canvas_group_member_remove(pd->pan, item);
return EINA_TRUE;
}