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 b7167838a3

Change-Id: Iaf41750df213908ba1e5b19ceae418abea76ad58
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2024-09-17 10:24:12 +02:00
parent 7781e852e0
commit 9a79c669da

View File

@@ -1863,6 +1863,8 @@ void EditorManagerPrivate::addEditorArea(EditorArea *area)
&EditorArea::hidden,
d,
[area = QPointer<EditorArea>(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) {