diff options
author | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2020-09-07 14:35:12 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2020-09-07 15:18:12 +0900 |
commit | cb059ea0afde20535d1521da510f74411b96a605 (patch) | |
tree | 31237b1c7b4aac54e37ce3ef0b6d69bdcc4ccd3a | |
parent | 5d058c98fd288588c1a6ac80bb631e01ad5569ff (diff) | |
download | efl-cb059ea0afde20535d1521da510f74411b96a605.tar.gz |
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.c | 4 |
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, * send ptr to user * callback */ { + Eina_Inlist *itr; Func_Data *cb_info; - EINA_INLIST_FOREACH(gesture->cbs[gesture->state], cb_info) + /* elm_gesture_layer_cb_del can be called in Elm_Gesture_Event_Cb cb */ + EINA_INLIST_FOREACH_SAFE(gesture->cbs[gesture->state], itr, cb_info) flags |= cb_info->cb(cb_info->user_data, info); } |