efl_ui_grid: do not delete a item that is not part of this container
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 24 Apr 2019 17:16:57 +0000 (19:16 +0200)
committerWoochanlee <wc0917.lee@samsung.com>
Tue, 30 Apr 2019 01:03:03 +0000 (10:03 +0900)
otherwise we start to delete callbacks etc. on a widget that we do not
have.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8706

src/lib/elementary/efl_ui_grid.c

index 2d2afe0..6736249 100644 (file)
@@ -1063,6 +1063,12 @@ _efl_ui_grid_efl_pack_unpack(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx_Entity *subo
 {
    Efl_Ui_Grid_Item *item = (Efl_Ui_Grid_Item *)subobj;
 
+   if (!eina_list_data_find(pd->items, item))
+     {
+        ERR("Element is not part of this container");
+        return EINA_FALSE;
+     }
+
    _grid_item_unpack_internal(obj, pd, item);
 
    elm_layout_sizing_eval(obj);