xwayland: Fix crash on weston shutdown

commit e7fff215ad made initializing the
selection_listener conditional, but didn't make its clean-up
conditional at shutdown.  Simply initializing the listener's list
link at init time makes this harmless.

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@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Derek Foreman 7 years ago
parent f85bf152c1
commit 4b72ff0e89
  1. 2
      xwayland/selection.c

@ -681,6 +681,8 @@ weston_wm_selection_init(struct weston_wm *wm)
struct weston_seat *seat;
uint32_t values[1], mask;
wl_list_init(&wm->selection_listener.link);
wm->selection_request.requestor = XCB_NONE;
values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE;

Loading…
Cancel
Save