sanghyeonlee pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=bdd6456ab5574829b6c62753590afb04fd74838b

commit bdd6456ab5574829b6c62753590afb04fd74838b
Author: SangHyeon Lee <dltkdgus1...@gmail.com>
Date:   Mon Jul 20 00:09:23 2015 +0900

    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.
---
 src/lib/elm_genlist.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 8a8b47b..b284117 100644
--- a/src/lib/elm_genlist.c
+++ b/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;

-- 


Reply via email to