opengl: Do not crash when programGuard is a nullptr
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 <samuel.rodal@nokia.com>
This commit is contained in:
parent
89aee9ecde
commit
f1a67c6531
@ -936,7 +936,7 @@ void QOpenGLShaderProgram::release()
|
||||
{
|
||||
Q_D(QOpenGLShaderProgram);
|
||||
#ifndef QT_NO_DEBUG
|
||||
if (d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
|
||||
if (d->programGuard && d->programGuard->group() != QOpenGLContextGroup::currentContextGroup())
|
||||
qWarning("QOpenGLShaderProgram::release: program is not valid in the current context.");
|
||||
#endif
|
||||
d->glfuncs->glUseProgram(0);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user