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);
|
Q_D(QOpenGLShaderProgram);
|
||||||
#ifndef QT_NO_DEBUG
|
#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.");
|
qWarning("QOpenGLShaderProgram::release: program is not valid in the current context.");
|
||||||
#endif
|
#endif
|
||||||
d->glfuncs->glUseProgram(0);
|
d->glfuncs->glUseProgram(0);
|
||||||
|
@ -980,7 +980,7 @@ void QGLShaderProgram::release()
|
|||||||
{
|
{
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
Q_D(QGLShaderProgram);
|
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.");
|
qWarning("QGLShaderProgram::release: program is not valid in the current context.");
|
||||||
#endif
|
#endif
|
||||||
#if defined(QT_OPENGL_ES_2)
|
#if defined(QT_OPENGL_ES_2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user