jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3d452bdc60b2e353f2728d3ab2894849011c6b4f
commit 3d452bdc60b2e353f2728d3ab2894849011c6b4f Author: Shilpa Singh <shilpa.si...@samsung.com> Date: Tue Dec 13 20:56:18 2016 +0900 elc_naviframe: Delete naviframe items in LIFO manner on widget deletion. Summary: Naviframe manages items in the form of a stack, but deletion is happening in FIFO manner, the deletion of items on widget deletion should also happen in LIFO manner. Use Case: Application allocates memory on first push and passes down the same handle for all subsequent pushes, now on deletion as first item is deleted first crash happens when the memory is accessed in second item on its deletion. hence Naviframe should also delete items in LIFO manner. @feature Test Plan: elementary_test->naviframe->push multiple pages Now terminate the app, the items should be deleted in LIFO manner. Reviewers: Hermet, Jaehyun, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, govi, rajeshps, jpeg Differential Revision: https://phab.enlightenment.org/D4483 --- src/lib/elementary/elc_naviframe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 81d20fb..de789a0 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -1458,12 +1458,15 @@ _elm_naviframe_efl_canvas_group_group_del(Eo *obj, Elm_Naviframe_Data *sd) { Elm_Naviframe_Item_Data *it; Elm_Naviframe_Op *nfo; + Eina_Inlist *l = NULL; sd->on_deletion = EINA_TRUE; + if (sd->stack) l = sd->stack->last; - while (sd->stack) + while (l) { - it = EINA_INLIST_CONTAINER_GET(sd->stack, Elm_Naviframe_Item_Data); + it = EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item_Data); + l = l->prev; elm_wdg_item_del(EO_OBJ(it)); } --