edje: fix lifecycle of swallowed children

Summary:
a swallowed child is per doc not deleted when the edje is deleted.
After the call to invalidate is finished all children will loose theire
parents and also be invalidated. However, in the efl_invalidate call,
the event EVAS_CALLBACK_DEL is issued, so this is the right spot. As in
legacy the swallows are in place when the EVAS_CALLBACK_DEL event is
issued.

Reviewers: cedric, raster, JackDanielZ, zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6222

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
This commit is contained in:
Marcel Hollerbach 2018-05-28 21:38:40 -07:00 committed by Cedric BAIL
parent bab45b8537
commit 665e88f8b4
1 changed files with 20 additions and 0 deletions

View File

@ -48,12 +48,32 @@ _efl_canvas_layout_efl_object_constructor(Eo *obj, Edje *ed)
return obj;
}
EOLIAN static void
_efl_canvas_layout_efl_object_invalidate(Eo *obj, Edje *ed)
{
_edje_file_callbacks_del(ed, NULL);
efl_invalidate(efl_super(obj, MY_CLASS));
//invalidate is done, this means the legacy evas deletion event is called.
for (int i = 0; i < ed->table_parts_size; ++i)
{
Edje_Real_Part *rp = ed->table_parts[i];
switch(rp->type)
{
case EDJE_RP_TYPE_SWALLOW:
_edje_real_part_swallow_clear(ed, rp);
break;
case EDJE_RP_TYPE_CONTAINER:
if (rp->part->type == EDJE_PART_TYPE_BOX)
_edje_real_part_box_remove_all(ed, rp, 0);
else if (rp->part->type == EDJE_PART_TYPE_TABLE)
_edje_real_part_table_clear(ed, rp, 0);
break;
}
}
}
EOLIAN static void