diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-11-07 11:56:48 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2018-11-07 18:33:33 +0000 |
commit | 6c08137faf1a53db879701126608833474a2450b (patch) | |
tree | 5aa9bb0f3093c74acd5620012eb190bbd4dcf362 /src/quick/scenegraph/qsgrenderloop.cpp | |
parent | 74a5ce02667ceefe31aba9a23246b9c512527014 (diff) |
Fix null pointer access in QQuickOpenGLShaderEffectMaterialCache
If a QQuickWindow is destroyed without ever being rendered, then there won't be
any QOpenGLContext in QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache.
Same goes for QQuickWidgetRenderControl.
Fixes: QTBUG-65236
Change-Id: I2742505d147bc8444b46688170d33fbb2844f2ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 3d579fde46..2e91bafa7c 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -334,7 +334,8 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window) qCDebug(QSG_LOG_RENDERLOOP, "cleanup without an OpenGL context"); #if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) - QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); + if (current) + QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif d->cleanupNodesOnShutdown(); |