Do not re-create windows during application shutdown
Change 9c3a58a913
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>
This commit is contained in:
parent
d5db8dbfec
commit
bf28e2fc13
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user