From cbde6377f7b626d25dc8e3e63d6b3606b9321278 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 19 Jun 2019 14:05:55 -0400 Subject: [PATCH] efl_ui/active_view: fix object destruction when the activeview is being destroyed, we can skip a lot of steps in unregistering widgets due to hierarchy-enforced deletion and class chaining of destructors. on the flip side, we also need to be cautious of triggering codepaths that will perpetuate object lifecycles past when they should be destroyed and trigger unwanted behavior. for this case, when the activeview is being destroyed we can simply efl_del all the contents to reuse existing callbacks, and then we can skip doing all the update propagation through activeview subcomponents since those will be destroyed presently. also, these subcomponents already handle subobject destruction with callbacks, so they'll automatically clean everything up. probably. Reviewed-by: Marcel Hollerbach Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9125 --- src/lib/elementary/efl_ui_active_view_container.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_active_view_container.c b/src/lib/elementary/efl_ui_active_view_container.c index 9d19b07cf0..03eca6fab6 100644 --- a/src/lib/elementary/efl_ui_active_view_container.c +++ b/src/lib/elementary/efl_ui_active_view_container.c @@ -464,12 +464,10 @@ _unpack_all(Eo *obj EINA_UNUSED, { Eo *content = eina_list_data_get(pd->content_list); - _unpack(obj, pd, content, 0); - if (clear) efl_del(content); - - pd->content_list = eina_list_remove(pd->content_list, content); + else + _unpack(obj, pd, content, 0); } } @@ -503,6 +501,7 @@ _unpack(Eo *obj, pd->content_list = eina_list_remove(pd->content_list, subobj); _elm_widget_sub_object_redirect_to_top(obj, subobj); + if (!efl_alive_get(obj)) return; if (index < pd->curr.page) pd->curr.page--;