elm/genlist: check for item invalidation after setting item focus on click

Summary:
if the item is deleted during a focus callback then the remainder of this function
must be skipped in order to avoid crashing when attempting to access deallocated
memory

ref T7292

Reviewers: SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7292

Differential Revision: https://phab.enlightenment.org/D6831
This commit is contained in:
Mike Blumenkrantz 2018-08-21 10:26:37 -04:00
parent dcac8b24f1
commit daaf5ad190
1 changed files with 2 additions and 0 deletions

View File

@ -5100,6 +5100,8 @@ _item_mouse_up_cb(void *data,
if (sd->focused_item != EO_OBJ(it))
elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
if (efl_invalidated_get(EO_OBJ(it))) goto deleted;
if (sd->multi &&
((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
(evas_key_modifier_is_set(ev->modifiers, "Control"))))