summaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-02-05 15:59:29 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-02-07 10:56:37 -0600
commit4b72ff0e89c380d2dc3183bdc5be9f11fce16817 (patch)
tree09ace52fa3a9c1c073e289803580e028d58c9d8d /xwayland
parentf85bf152c197d4e378f5aa727cef0bde6afc4e80 (diff)
downloadweston-4b72ff0e89c380d2dc3183bdc5be9f11fce16817.tar.gz
xwayland: Fix crash on weston shutdown
commit e7fff215ada3fd3d1b2af664888f960c082f9065 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>
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 19a24d26..a7555704 100644
--- a/xwayland/selection.c
+++ b/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;