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.
This commit is contained in:
Jaehyun Cho 2020-09-07 14:35:12 +09:00
parent 5d058c98fd
commit cb059ea0af
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}