From 9a79c669dac8c9cdfb1818ed2881a6149f342f81 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 17 Sep 2024 10:24:12 +0200 Subject: [PATCH] EditorManager: Fix crash on shutdown Some plugins (Debugger) do a "delayed" shutdown, which triggers an event loop and the processing of async EditorArea "hidden" signals. The Debug mode is already deleted then, which leads to a crash when the "hidden" handler investigates the current mode. We don't need to do anything anymore when areas are hidden while shutting down, so just skip ahead in that case. Amends b7167838a3808d89a5f32831bac2ec3aba2bb435 Change-Id: Iaf41750df213908ba1e5b19ceae418abea76ad58 Reviewed-by: Christian Stenger --- src/plugins/coreplugin/editormanager/editormanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 1112620431f..bb0b65ebaf8 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1863,6 +1863,8 @@ void EditorManagerPrivate::addEditorArea(EditorArea *area) &EditorArea::hidden, d, [area = QPointer(area)] { + if (ExtensionSystem::PluginManager::isShuttingDown()) + return; // The connection is queued, because the hiding might be very short term, e.g. // when switching between Edit and Debug modes. Check if it is still hidden. const auto isReallyVisibile = [](QWidget *w) {