Windows QPA: Check QWindowsStaticOpenGLContext in nativeResourceForIntegration().

The instance of QWindowsStaticOpenGLContext has been observed to be 0.

Task-number: QTBUG-52387
Change-Id: I1ca97c6df0d96e732ae62354e03f465cd461bcb4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2016-04-06 09:57:43 +02:00
parent 7bd08f4bfd
commit 58c23ae161
1 changed files with 4 additions and 2 deletions

View File

@ -138,8 +138,10 @@ void *QWindowsNativeInterface::nativeResourceForIntegration(const QByteArray &re
#ifdef QT_NO_OPENGL
Q_UNUSED(resource)
#else
if (resourceType(resource) == GlHandleType)
return QWindowsIntegration::staticOpenGLContext()->moduleHandle();
if (resourceType(resource) == GlHandleType) {
if (const QWindowsStaticOpenGLContext *sc = QWindowsIntegration::staticOpenGLContext())
return sc->moduleHandle();
}
#endif
return 0;