[mutter] xwayland: Handle shutting down without having started
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] xwayland: Handle shutting down without having started
- Date: Thu, 6 May 2021 17:26:55 +0000 (UTC)
commit 4490d4524bda0f00c2fd688308c6061253170530
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu May 6 11:02:42 2021 +0200
xwayland: Handle shutting down without having started
We initialize, but might not start, e.g. when a test case just needs a
backend and doesn't start mutter. When cleaning up, we'll still try to
clean up Xwayland integration, and this commit handles cleaning up
without having made the mess.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1856>
src/wayland/meta-wayland.c | 2 +-
src/wayland/meta-xwayland.c | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 153d61954c..8f16aa429d 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -595,7 +595,7 @@ meta_wayland_finalize (void)
if (compositor->wayland_display)
wl_display_destroy_clients (compositor->wayland_display);
- meta_wayland_seat_free (compositor->seat);
+ g_clear_pointer (&compositor->seat, meta_wayland_seat_free);
g_clear_pointer (&compositor->display_name, g_free);
g_clear_pointer (&compositor->wayland_display, wl_display_destroy);
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index a2fb578abb..0d3468d57e 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -1286,7 +1286,8 @@ void
meta_xwayland_shutdown (MetaXWaylandManager *manager)
{
#ifdef HAVE_XSETIOERROREXITHANDLER
- MetaX11Display *x11_display = meta_get_display ()->x11_display;
+ MetaDisplay *display = meta_get_display ();
+ MetaX11Display *x11_display;
#endif
char path[256];
@@ -1294,8 +1295,12 @@ meta_xwayland_shutdown (MetaXWaylandManager *manager)
XSetIOErrorHandler (x_io_error_noop);
#ifdef HAVE_XSETIOERROREXITHANDLER
- XSetIOErrorExitHandler (meta_x11_display_get_xdisplay (x11_display),
- x_io_error_exit_noop, NULL);
+ x11_display = display->x11_display;
+ if (x11_display)
+ {
+ XSetIOErrorExitHandler (meta_x11_display_get_xdisplay (x11_display),
+ x_io_error_exit_noop, NULL);
+ }
#endif
meta_xwayland_terminate (manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]