diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-17 14:22:46 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-18 14:04:29 +0000 |
commit | 0f6ace8118c72781e6c4c68c3dc98a2937fedf35 (patch) | |
tree | fe8cc26af844ec74329b4fb3a529b6b817b21401 | |
parent | 960a1e3bf3414a59e7bd436b3a2d63a595b34dc8 (diff) |
winrt: Fix crash when managing multiple top-level windows
When a window gets removed, the active focus window needs to be set to 0
instead of the the current window. Otherwise
QGuiApplicationPrivate::focus_window is set to an invalid pointer and
crashes when dereferenced.
Change-Id: I258b95e447de4cbfb7f19955079c2545a738e03f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index c1118cd0b8..703627a6c5 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -782,7 +782,7 @@ void QWinRTScreen::removeWindow(QWindow *window) if (!d->visibleWindows.removeAll(window)) return; if (wasTopWindow) - QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); + QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason); handleExpose(); QWindowSystemInterface::flushWindowSystemEvents(); #if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP) |