From 9c3b130f67bc38aca56fabb9862e5d43f615e161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 8 Jun 2023 02:52:00 +0200 Subject: [PATCH] display: Fix destruction order MetaCompositorX11 might need the MetaDisplay's x11_display during shutdown (meta_sync_ring_destroy -> meta_sync_free), and `meta_display_shutdown_x11()` needs the MetaStack as it calls `meta_stack_{freeze,thaw}()`. So fix the order of destruction so that dependencies are destroyed after dependants. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2852 Part-of: --- src/core/display.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 49ef10df8..3000ab8b3 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1257,13 +1257,12 @@ meta_display_close (MetaDisplay *display, /* Stop caring about events */ meta_display_free_events (display); - meta_display_shutdown_x11 (display); - - g_clear_object (&display->stack); g_clear_pointer (&display->stack_tracker, meta_stack_tracker_free); g_clear_pointer (&display->compositor, meta_compositor_destroy); + meta_display_shutdown_x11 (display); + g_clear_object (&display->stack); /* Must be after all calls to meta_window_unmanage() since they * unregister windows