Allow sharing contexts in QOpenGLTexture::destroy()

Checking for the exact same context is too strict. The texture is valid
in sharing contexts too.

Task-number: QTBUG-47521
Change-Id: Ifdf329ef5361b48abcb7c69e08acd7e35d624a08
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
bb10
Laszlo Agocs 2015-07-31 11:22:06 +02:00
parent a416647e38
commit 771235285c
1 changed files with 3 additions and 2 deletions

View File

@ -179,8 +179,9 @@ void QOpenGLTexturePrivate::destroy()
// not created or already destroyed
return;
}
if (QOpenGLContext::currentContext() != context) {
qWarning("Requires a valid current OpenGL context.\n"
QOpenGLContext *currentContext = QOpenGLContext::currentContext();
if (!currentContext || !QOpenGLContext::areSharing(currentContext, context)) {
qWarning("Texture is not valid in the current context.\n"
"Texture has not been destroyed");
return;
}