Windows QPA: Fix potential crash in leave event handling

Add a check for window != nullptr.
Amends af5c8d04fb0c9ddda58925e4862e857c78a5e563.

Task-number: QTBUG-67101
Task-number: QTBUG-57864
Change-Id: I2bbbbe514fc494fd569d0932d508c53c0544f665
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Friedemann Kleint 2018-03-19 09:08:01 +01:00 committed by Allan Sandfeld Jensen
parent 323b00e38c
commit 1cb439dc94

View File

@ -1083,7 +1083,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::LeaveEvent:
{
QWindow *window = platformWindow->window();
while (window->flags() & Qt::WindowTransparentForInput)
while (window && (window->flags() & Qt::WindowTransparentForInput))
window = window->parent();
if (!window)
return false;