summaryrefslogtreecommitdiff
path: root/xwayland/launcher.c
diff options
context:
space:
mode:
authorDima Ryazanov <dima@gmail.com>2014-06-19 01:03:31 -0700
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-08-27 14:49:16 +0300
commit434cc234268c5ffc8e7fa7d672feafe8c987c5ef (patch)
tree91c6d43a72e62d6edc3747d303a054a6dbede51c /xwayland/launcher.c
parent68c83cae2435326f4d7e2a1c8e89ac13a8f9fd3d (diff)
downloadweston-434cc234268c5ffc8e7fa7d672feafe8c987c5ef.tar.gz
weston-434cc234268c5ffc8e7fa7d672feafe8c987c5ef.tar.bz2
weston-434cc234268c5ffc8e7fa7d672feafe8c987c5ef.zip
xwayland: Clean up the WM properly if X server crashes
The X cleanup code uses wxs->wm to check if the WM has been created - but that variable was never initialized. So if X crashes, the WM doesn't get destroyed, causing a crash when it tries to repaint a window. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'xwayland/launcher.c')
-rw-r--r--xwayland/launcher.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xwayland/launcher.c b/xwayland/launcher.c
index bf1e17eb..df2efd2e 100644
--- a/xwayland/launcher.c
+++ b/xwayland/launcher.c
@@ -43,7 +43,7 @@ handle_sigusr1(int signal_number, void *data)
/* We'd be safer if we actually had the struct
* signalfd_siginfo from the signalfd data and could verify
* this came from Xwayland.*/
- weston_wm_create(wxs, wxs->wm_fd);
+ wxs->wm = weston_wm_create(wxs, wxs->wm_fd);
wl_event_source_remove(wxs->sigusr1_source);
return 1;
@@ -163,8 +163,10 @@ weston_xserver_shutdown(struct weston_xserver *wxs)
}
close(wxs->abstract_fd);
close(wxs->unix_fd);
- if (wxs->wm)
+ if (wxs->wm) {
weston_wm_destroy(wxs->wm);
+ wxs->wm = NULL;
+ }
wxs->loop = NULL;
}