From 771235285c5306dd385fbd0be64ab4120a916e1c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 31 Jul 2015 11:22:06 +0200 Subject: 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 --- src/gui/opengl/qopengltexture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 5edaddcd6a..5271826015 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -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; } -- cgit v1.2.3