From f1a67c65312e62c30698c07ab382db64998b8d56 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 19 Nov 2011 20:57:14 +0100 Subject: opengl: Do not crash when programGuard is a nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rest of the code is checking programGuard for nullptr, do it here as well to prevent a segmentation fault. Change-Id: I38a03f74d493b8f731157be1739707b39904f7ba Reviewed-by: Samuel Rødal --- src/opengl/qglshaderprogram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl/qglshaderprogram.cpp') diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 0163d60f0c..af093bc9b4 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -980,7 +980,7 @@ void QGLShaderProgram::release() { #ifndef QT_NO_DEBUG Q_D(QGLShaderProgram); - if (d->programGuard->group() != QOpenGLContextGroup::currentContextGroup()) + if (d->programGuard && d->programGuard->group() != QOpenGLContextGroup::currentContextGroup()) qWarning("QGLShaderProgram::release: program is not valid in the current context."); #endif #if defined(QT_OPENGL_ES_2) -- cgit v1.2.3