summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-09-24 15:08:09 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-10-06 16:01:11 +0200
commitbf28e2fc133c8d9f966cd2db51f7c76928395e0d (patch)
tree64ede96d2f5fdb0f528a16c6cf647ec09d0b3952 /src/gui/kernel/qwindow.cpp
parentd5db8dbfec198496967b8cb034ca5846e152db95 (diff)
Do not re-create windows during application shutdown
Change 9c3a58a913a7e59359146264ee59d40d703d4db2 causes any window to be re-created when the screen it is shown on is destroyed. This is for the use case of detaching one monitor while another remains. In QWindow::setScreen(), if the screen is null, it will be set to the primary screen. However during application shutdown, it may be that the primary screen has been destroyed before all the windows are destroyed; so trying to set it anyway will cause a crash. qtdeclarative/tests/auto/quick/qquickwindow was segfaulting, especially when running testWindowVisibilityOrder by itself. Change-Id: Ice6b30320ac563f0c70264aa5c57de21d2e4d56e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index f52e12c6a8..af3b27fd10 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1697,7 +1697,7 @@ void QWindow::setScreen(QScreen *newScreen)
void QWindow::screenDestroyed(QObject *object)
{
Q_D(QWindow);
- if (d->parentWindow)
+ if (d->parentWindow || QGuiApplication::closingDown())
return;
if (object == static_cast<QObject *>(d->topLevelScreen)) {
const bool wasVisible = isVisible();