check for invalid contexts added

This commit is contained in:
Uwe Rathmann 2018-02-06 07:51:33 +01:00
parent 84d8c87309
commit 3ddcb3706f

View File

@ -176,12 +176,19 @@ QskTextureNode::~QskTextureNode()
Q_D( QskTextureNode );
if ( d->material.textureId() > 0 )
{
/*
In certain environments we have the effect, that at
program termination the context is already gone
*/
if ( auto context = QOpenGLContext::currentContext() )
{
GLuint id = d->material.textureId();
auto funcs = QOpenGLContext::currentContext()->functions();
auto funcs = context->functions();
funcs->glDeleteTextures( 1, &id );
}
}
}
void QskTextureNode::setRect(const QRectF& r)