Avoid crashing in offscreen with X11 builtin but not available

Pick-to: 5.15
Change-Id: Id385bc750f1cc6dfc2ad7e0248dbc56fa5b6e4d2
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
bb10
Allan Sandfeld Jensen 2020-09-08 12:03:48 +02:00
parent d9d18596e2
commit aa5f3c829c
1 changed files with 4 additions and 2 deletions

View File

@ -118,13 +118,15 @@ void *QOffscreenX11Integration::nativeResourceForContext(const QByteArray &resou
if (resource.toLower() == QByteArrayLiteral("glxconfig") ) {
if (context) {
QOffscreenX11GLXContext *glxPlatformContext = static_cast<QOffscreenX11GLXContext *>(context->handle());
return glxPlatformContext->glxConfig();
if (glxPlatformContext)
return glxPlatformContext->glxConfig();
}
}
if (resource.toLower() == QByteArrayLiteral("glxcontext") ) {
if (context) {
QOffscreenX11GLXContext *glxPlatformContext = static_cast<QOffscreenX11GLXContext *>(context->handle());
return glxPlatformContext->glxContext();
if (glxPlatformContext)
return glxPlatformContext->glxContext();
}
}
return nullptr;