From 500deb9a08242d177fdad9a8b5a57b560e754db1 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 30 Aug 2013 13:21:31 +0200 Subject: [PATCH] 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 Reviewed-by: Andy Nichols --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 08f68a20f4..c2d04b17c8 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -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(window->handle()->screen())->display(); else return static_cast(mScreen)->display();