main: Avoid calling meta_wayland_compositor_get_default() on X11

Because it contains an assertion that will fail, and crash.
Started in 301d2c55c6.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1883>
This commit is contained in:
Daniel van Vugt 2021-06-02 16:45:04 +08:00
parent 936696afcf
commit ea626a5059

View File

@ -309,13 +309,16 @@ meta_finalize (void)
MetaDisplay *display = meta_get_display ();
MetaBackend *backend = meta_get_backend ();
#ifdef HAVE_WAYLAND
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
MetaWaylandCompositor *compositor = NULL;
#endif
if (backend)
meta_backend_prepare_shutdown (backend);
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ())
compositor = meta_wayland_compositor_get_default ();
if (compositor)
meta_wayland_compositor_prepare_shutdown (compositor);
#endif