summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-07-31 11:22:06 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-04 10:28:07 +0000
commit771235285c5306dd385fbd0be64ab4120a916e1c (patch)
treed5461bfc4b464081a612e6ff8ac0dd0e314dc262 /src/gui/opengl/qopengltexture.cpp
parenta416647e385e3d9bd394e960d108bc11d3209d5b (diff)
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>
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-rw-r--r--src/gui/opengl/qopengltexture.cpp5
1 files 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;
}