summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2020-09-07 14:35:12 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2020-09-07 15:18:12 +0900
commitcb059ea0afde20535d1521da510f74411b96a605 (patch)
tree31237b1c7b4aac54e37ce3ef0b6d69bdcc4ccd3a
parent5d058c98fd288588c1a6ac80bb631e01ad5569ff (diff)
elm_gesture_layer: fix crash caused by elm_gesture_layer_cb_del in cb
elm_gesture_layer_cb_del can be called in Elm_Gesture_Event_Cb cb set by elm_gesture_layer_cb_set and cb_info of the cb is free in the cb. This causes crash if cb_info is searched with EINA_INLIST_FOREACH.
-rw-r--r--src/lib/elementary/elm_gesture_layer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c
index e7fb88348c..5e6932c0af 100644
--- a/src/lib/elementary/elm_gesture_layer.c
+++ b/src/lib/elementary/elm_gesture_layer.c
@@ -614,8 +614,10 @@ _state_report(Gesture_Info *gesture,
614 * send ptr to user 614 * send ptr to user
615 * callback */ 615 * callback */
616 { 616 {
617 Eina_Inlist *itr;
617 Func_Data *cb_info; 618 Func_Data *cb_info;
618 EINA_INLIST_FOREACH(gesture->cbs[gesture->state], cb_info) 619 /* elm_gesture_layer_cb_del can be called in Elm_Gesture_Event_Cb cb */
620 EINA_INLIST_FOREACH_SAFE(gesture->cbs[gesture->state], itr, cb_info)
619 flags |= cb_info->cb(cb_info->user_data, info); 621 flags |= cb_info->cb(cb_info->user_data, info);
620 } 622 }
621 623