diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-07-31 11:22:06 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-04 10:28:07 +0000 |
commit | 771235285c5306dd385fbd0be64ab4120a916e1c (patch) | |
tree | d5461bfc4b464081a612e6ff8ac0dd0e314dc262 | |
parent | a416647e385e3d9bd394e960d108bc11d3209d5b (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>
-rw-r--r-- | src/gui/opengl/qopengltexture.cpp | 5 |
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; } |