[PATCH weston] xwayland: Fix crash on weston shutdown

Derek Foreman derekf at osg.samsung.com
Mon Feb 5 22:02:34 UTC 2018


commit e7fff215ada3fd3d1b2af664888f960c082f9065 made initializing the
selection_listener conditional, but didn't make its clean-up
conditional at shutdown.

To see this, run weston -Bheadless-backend.so and then connect to it
with an X client.  When killing weston it will attempt shutdown but
die with a segfault.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 xwayland/window-manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index ac44a29a..c565d21f 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -2618,7 +2618,8 @@ weston_wm_destroy(struct weston_wm *wm)
 	weston_wm_destroy_cursors(wm);
 	xcb_disconnect(wm->conn);
 	wl_event_source_remove(wm->source);
-	wl_list_remove(&wm->selection_listener.link);
+	if (wm->selection_listener.notify)
+		wl_list_remove(&wm->selection_listener.link);
 	wl_list_remove(&wm->activate_listener.link);
 	wl_list_remove(&wm->kill_listener.link);
 	wl_list_remove(&wm->create_surface_listener.link);
-- 
2.14.3



More information about the wayland-devel mailing list