xwm: remove configure_source on destroy

It would lead to use-after-free if there was a pending idle callback to
weston_wm_window_configure() when the weston_wm_window gets destroyed. Make
sure the callback will not fire.

Found by inspection.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2019-12-05 16:42:48 +02:00 committed by Daniel Stone
parent a24989e47b
commit dcd2b420a6

View File

@ -1514,6 +1514,8 @@ weston_wm_window_destroy(struct weston_wm_window *window)
weston_output_weak_ref_clear(&window->legacy_fullscreen_output);
if (window->configure_source)
wl_event_source_remove(window->configure_source);
if (window->repaint_source)
wl_event_source_remove(window->repaint_source);
if (window->cairo_surface)