summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-31 13:51:38 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-31 13:52:51 +0100
commit509ad380832736361e01510991d27c67f8d10664 (patch)
tree1378a8563beb79c7c731aa206efd90cff3a0bb17
parent260964dbdd82354e6a616e3d3b96bd184fd139aa (diff)
evas_object_grid: fix leaking of pointer
priv->children was leaked to a freed pointer here. This is now fixed.
-rw-r--r--src/lib/evas/canvas/evas_object_grid.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_object_grid.c b/src/lib/evas/canvas/evas_object_grid.c
index 72cb176..cecff65 100644
--- a/src/lib/evas/canvas/evas_object_grid.c
+++ b/src/lib/evas/canvas/evas_object_grid.c
@@ -176,16 +176,14 @@ static void
176_evas_object_grid_smart_del(Evas_Object *o) 176_evas_object_grid_smart_del(Evas_Object *o)
177{ 177{
178 EVAS_OBJECT_GRID_DATA_GET(o, priv); 178 EVAS_OBJECT_GRID_DATA_GET(o, priv);
179 Eina_List *l;
180 179
181 l = priv->children; 180 while (priv->children)
182 while (l)
183 { 181 {
184 Evas_Object_Grid_Option *opt = l->data; 182 Evas_Object_Grid_Option *opt = priv->children->data;
185 _evas_object_grid_child_disconnect(o, opt->obj); 183 _evas_object_grid_child_disconnect(o, opt->obj);
186 _evas_object_grid_option_del(opt->obj); 184 _evas_object_grid_option_del(opt->obj);
187 free(opt); 185 free(opt);
188 l = eina_list_remove_list(l, l); 186 priv->children = eina_list_remove_list(priv->children, priv->children);
189 } 187 }
190 188
191 _evas_object_grid_parent_sc->del(o); 189 _evas_object_grid_parent_sc->del(o);
@@ -352,7 +350,7 @@ _evas_grid_pack(Eo *o, Evas_Grid_Data *priv, Evas_Object *child, int x, int y, i
352 } 350 }
353 // FIXME: we could keep a changed list 351 // FIXME: we could keep a changed list
354 evas_object_smart_changed(o); 352 evas_object_smart_changed(o);
355 353
356 return EINA_TRUE; 354 return EINA_TRUE;
357} 355}
358 356
@@ -385,7 +383,7 @@ _evas_grid_unpack(Eo *o, Evas_Grid_Data *priv, Evas_Object *child)
385 _evas_object_grid_remove_opt(priv, opt); 383 _evas_object_grid_remove_opt(priv, opt);
386 evas_object_smart_member_del(child); 384 evas_object_smart_member_del(child);
387 free(opt); 385 free(opt);
388 386
389 return EINA_TRUE; 387 return EINA_TRUE;
390} 388}
391 389