efl_ui_collection: do not leak
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Mon, 9 Dec 2019 17:42:02 +0000 (18:42 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 16 Dec 2019 03:26:45 +0000 (12:26 +0900)
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

src/lib/elementary/efl_ui_collection.c

index dfbd77b..2ff6b54 100644 (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;
 }