diff options
author | Jeffy Chen <jeffy.chen@rock-chips.com> | 2019-09-02 10:15:26 +0800 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2019-11-21 16:54:38 +0000 |
commit | 179458ad23a0e7b81fa9e83245ea8cee43e4fa14 (patch) | |
tree | 04b8ad574d1cc1cad23c65ade97aca59a1244206 | |
parent | f568968f8a30eab6bfd8a15518014deb8f6c81d5 (diff) |
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>
-rw-r--r-- | clients/window.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clients/window.c b/clients/window.c index 1c5a81f1..3d1e8e4a 100644 --- a/clients/window.c +++ b/clients/window.c @@ -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) |