aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-21 10:26:37 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-21 10:26:38 -0400
commitdaaf5ad190ab635567999e0f07ca08781afedb29 (patch)
tree9499042b784b48cb4265073cfe125b08629b62c3
parentelm/genlist: unset callbacks flag when destroying view object in unrealize (diff)
downloadefl-daaf5ad190ab635567999e0f07ca08781afedb29.tar.gz
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 https://phab.enlightenment.org/T7292 Reviewers: SanghyeonLee Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: https://phab.enlightenment.org/T7292 Differential Revision: https://phab.enlightenment.org/D6831
-rw-r--r--src/lib/elementary/elm_genlist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 7283f15332..03598de77c 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -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"))))