mirror of
https://github.com/lvgl/lvgl.git
synced 2026-09-24 07:24:57 +08:00
fix(indev): fix indev gesture occasional crash (#8146)
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
This commit is contained in:
@@ -778,6 +778,12 @@ static void process_touch_event(lv_indev_touch_data_t * touch, lv_indev_gesture_
|
||||
|
||||
/* Mark last item as un-used */
|
||||
motion = get_motion(touch->id, g);
|
||||
|
||||
if(motion == NULL) {
|
||||
LV_LOG_ERROR("Released touch not found (id=%d)", touch->id);
|
||||
return;
|
||||
}
|
||||
|
||||
motion->finger = -1;
|
||||
motion->state = touch->state;
|
||||
}
|
||||
@@ -808,6 +814,12 @@ static void process_touch_event(lv_indev_touch_data_t * touch, lv_indev_gesture_
|
||||
}
|
||||
else if(motion_idx >= 0) {
|
||||
motion = get_motion(touch->id, g);
|
||||
|
||||
if(motion == NULL) {
|
||||
LV_LOG_ERROR("Active touch missing (id=%d state=%d)", touch->id, touch->state);
|
||||
return;
|
||||
}
|
||||
|
||||
motion->point.x = touch->point.x;
|
||||
motion->point.y = touch->point.y;
|
||||
motion->state = touch->state;
|
||||
|
||||
Reference in New Issue
Block a user