aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-02-04 09:28:14 +0100
committerEike Ziller <eike.ziller@qt.io>2021-02-05 11:27:43 +0000
commit8875c59021586bf66b38299873dd05f440a99665 (patch)
tree08bf93bdd805d16e3b636ee1ac7628ede4f8b859
parentc25afb1b598ad566e6b0db6be91e7b110269dbb3 (diff)
Core: Do not remove context objects during shutdown
Like we suppress context updates during shutdown also disconnect from the context object's destroyed signal. At that point we don't care anymore. This also avoids issues if the context object lives as the child of a widget in the MainWindow geometry. These widgets (and respectively their children) are destroyed only in the QObject destructor, i.e. after the MainWindow itself already destroyed all its members, including the m_contextWidgets map. Amends 6d97c1fcb1f0a8c712d902065a887f8b74c61cf4 Fixes: QTCREATORBUG-25310 Change-Id: I75db6f8783b5f62aa9805b69d4d2bba07b906a5b Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 6fb5e170dd..aececbbb2d 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -1016,6 +1016,8 @@ void MainWindow::updateContextObject(const QList<IContext *> &context)
void MainWindow::aboutToShutdown()
{
disconnect(qApp, &QApplication::focusChanged, this, &MainWindow::updateFocusWidget);
+ for (auto contextPair : m_contextWidgets)
+ disconnect(contextPair.second, &QObject::destroyed, this, nullptr);
m_activeContext.clear();
hide();
}