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.
This commit is contained in:
SangHyeon Lee 2015-07-20 00:09:23 +09:00
parent d9c18d9814
commit 4e48054bb8
1 changed files with 2 additions and 1 deletions

View File

@ -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;