From 4651aecaee320b74b6ffcb6fe34fc3d43726010e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Mon, 12 Nov 2018 12:38:48 +0100 Subject: Fix more null pointer accesses in QQuickOpenGLShaderEffectMaterialCache This amends 6c08137faf1a53db879701126608833474a2450b. Fixes: QTBUG-71705 Change-Id: I0e9ca137c039802d348af4a29146395155e497c0 Reviewed-by: Liang Qi Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 3 ++- src/quick/scenegraph/qsgwindowsrenderloop.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/quick/scenegraph') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 8262708320..c18ba4226c 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -499,7 +499,8 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor, QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window); #if QT_CONFIG(quick_shadereffect) - QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); + if (current) + QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif // The canvas nodes must be cleaned up regardless if we are in the destructor.. diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 3b2737b8e1..95df700a15 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -246,7 +246,8 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window) RLDEBUG("cleanup without an OpenGL context"); #if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) - QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); + if (current) + QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif d->cleanupNodesOnShutdown(); -- cgit v1.2.3