From dcd2b420a6bca2073ebf56284e56aeb9cb47622e Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 5 Dec 2019 16:42:48 +0200 Subject: [PATCH] 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 --- xwayland/window-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 0fe33dcf..eaa96901 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -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)