clients: Drop corresponding touch points when destroying windows

This is to avoid memory leaking of these touch points.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen 2019-09-02 10:15:26 +08:00 committed by Daniel Stone
parent f568968f8a
commit 179458ad23

View File

@ -1568,8 +1568,18 @@ window_destroy(struct window *window)
wl_list_remove(&window->redraw_task.link);
wl_list_for_each(input, &display->input_list, link) {
if (input->touch_focus == window)
if (input->touch_focus == window) {
struct touch_point *tp, *tmp;
wl_list_for_each_safe(tp, tmp,
&input->touch_point_list,
link) {
wl_list_remove(&tp->link);
free(tp);
}
input->touch_focus = NULL;
}
if (input->pointer_focus == window)
input->pointer_focus = NULL;
if (input->keyboard_focus == window)