forked from qt-creator/qt-creator
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:
@@ -1863,6 +1863,8 @@ void EditorManagerPrivate::addEditorArea(EditorArea *area)
|
|||||||
&EditorArea::hidden,
|
&EditorArea::hidden,
|
||||||
d,
|
d,
|
||||||
[area = QPointer<EditorArea>(area)] {
|
[area = QPointer<EditorArea>(area)] {
|
||||||
|
if (ExtensionSystem::PluginManager::isShuttingDown())
|
||||||
|
return;
|
||||||
// The connection is queued, because the hiding might be very short term, e.g.
|
// 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.
|
// when switching between Edit and Debug modes. Check if it is still hidden.
|
||||||
const auto isReallyVisibile = [](QWidget *w) {
|
const auto isReallyVisibile = [](QWidget *w) {
|
||||||
|
Reference in New Issue
Block a user