From 0090384ef5ac9f9e939874a1bbf233298c9db930 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 24 May 2018 14:56:30 -0700 Subject: [PATCH] elm_ctxpopup: prevent a giant load of errors Summary: i) There have been 2 sorts of errors, first the items have been deleted after the list was deleted, thus the list items have already been destructed. which lead to the error as the popup items destroyed the list items on destruction as well. ii) sd->box was attached to the ctxpopup when getting into group_del the box has already been destroyed by the cleanup logic. Subscribers: cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6166 Reviewed-by: Cedric BAIL --- src/lib/elementary/elc_ctxpopup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index 9423e04fce..29915182ef 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -1103,18 +1103,17 @@ _elm_ctxpopup_efl_canvas_group_group_del(Eo *obj, Elm_Ctxpopup_Data *sd) { Elm_Object_Item *it; - evas_object_event_callback_del_full - (sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj); evas_object_event_callback_del(sd->content, EVAS_CALLBACK_DEL, _on_content_del); _parent_detach(obj); + //clear the items before clearing the ctxpopup as this will remove the list and all items + EINA_LIST_FREE(sd->items, it) + efl_del(it); + elm_ctxpopup_clear(obj); ELM_SAFE_FREE(sd->arrow, evas_object_del); /* stops _sizing_eval() from going on on deletion */ ELM_SAFE_FREE(sd->bg, evas_object_del); - EINA_LIST_FREE(sd->items, it) - efl_del(it); - efl_canvas_group_del(efl_super(obj, MY_CLASS)); }