summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2016-05-03 10:35:03 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2016-05-10 17:11:03 +0000
commitdbd81a0b9f884feae797c2a27a59cc9011fb32ff (patch)
treec66ed41d8b997a8f31018452d8fec16b7107584d
parent33c5df2887dc738f5c126e2fc406f7aecf63de5f (diff)
winrt: Fix potential startup crash
Depending on the windowstate passed to QWinRTWindow constructor we might act on the uiElement which has not been created yet. This happened especially in release mode, probably due to timing. Hence delay uiElement changes until we created it in the constructor and can ensure it is valid. Change-Id: I00daa9fcf8542a0535bbcb663a76d85c36e510e2 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index f5407f8779..75b43205b7 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -108,9 +108,6 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
d->surface = EGL_NO_SURFACE;
d->display = EGL_NO_DISPLAY;
d->screen = static_cast<QWinRTScreen *>(screen());
- setWindowFlags(window->flags());
- setWindowState(window->windowState());
- setWindowTitle(window->title());
handleContentOrientationChange(window->contentOrientation());
d->surfaceFormat.setAlphaBufferSize(0);
@@ -158,6 +155,10 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
});
Q_ASSERT_SUCCEEDED(hr);
+ setWindowFlags(window->flags());
+ setWindowState(window->windowState());
+ setWindowTitle(window->title());
+
setGeometry(window->geometry());
}