From 4e48054bb835d0a590ca0db53dc75eff5e18dd4a Mon Sep 17 00:00:00 2001 From: SangHyeon Lee Date: Mon, 20 Jul 2015 00:09:23 +0900 Subject: [PATCH] genlist : fix genlist dangling pointer crash in item select Summary: Fix genlist crash issue of T2553 which happened by dangling pointer access after deletion in item_select. after item_focused callback, user call deletion and item_select din't cover those cases. Resolves: T2553 @fix Test Plan: elementary_test -> genlist focus -> choose Genlist Cear on Focus then originally crash will be happened. This patch will solve that problem. --- legacy/elementary/src/lib/elm_genlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 8a8b47b..b284117 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -5738,12 +5738,13 @@ _item_select(Elm_Gen_Item *it) evas_object_ref(obj); + it->walking++; elm_object_item_focus_set(eo_it, EINA_TRUE); + if ((it->base)->on_deletion) goto item_deleted; _elm_genlist_item_content_focus_set(it, ELM_FOCUS_PREVIOUS); sd->last_selected_item = eo_it; _item_highlight(it); - it->walking++; if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); // delete item if it's requested deletion in the above callbacks. if ((it->base)->on_deletion) goto item_deleted; -- 2.7.4