summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2013-08-30 13:21:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-04 09:38:35 +0200
commit500deb9a08242d177fdad9a8b5a57b560e754db1 (patch)
tree2555ac536c4bba70a82457d744506761bf2a05a1 /src/plugins/platforms
parentafce2b528ce30e19af618b077e3f184cf290fa81 (diff)
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>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp2
1 files changed, 1 insertions, 1 deletions
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<QEglFSScreen *>(window->handle()->screen())->display();
else
return static_cast<QEglFSScreen *>(mScreen)->display();