eglfs: Check for a valid window handle before attempting to retrieve resources.

In the case of a window that is not yet shown, or destroyed, there
will not be a native handle, and this would crash.

Change-Id: Ib8c1a4490d82654d04073dac240eaa1275cbc1b0
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
bb10
Robin Burchell 2013-08-30 13:21:31 +02:00 committed by The Qt Project
parent afce2b528c
commit 500deb9a08
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWi
QByteArray lowerCaseResource = resource.toLower();
if (lowerCaseResource == "egldisplay") {
if (window)
if (window && window->handle())
return static_cast<QEglFSScreen *>(window->handle()->screen())->display();
else
return static_cast<QEglFSScreen *>(mScreen)->display();