From db91d949f7d1feeaae70ac4e17d3498da70fb9c5 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Mon, 8 Apr 2024 16:32:31 +0200 Subject: [PATCH] compositor: move wl_display_destroy_clients (#5498) if enough clients are open when destructing the compositor destroying clients will emit a wl_surface_unmap that a WLListener catches and doing so it calls listener_unmapLayerSurface that tries to iterate over input manager that is already destroyed, move the destruction of clients above g_pInputManager.reset() and removeAllSignals() to ensure we dont segfault at exit. --- src/Compositor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 5c42b8ff..fee98f8e 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -419,12 +419,10 @@ void CCompositor::cleanup() { g_pXWaylandManager->m_sWLRXWayland = nullptr; } + wl_display_destroy_clients(g_pCompositor->m_sWLDisplay); removeAllSignals(); g_pInputManager.reset(); - - wl_display_destroy_clients(g_pCompositor->m_sWLDisplay); - g_pDecorationPositioner.reset(); g_pCursorManager.reset(); g_pPluginSystem.reset();