diff options
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-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; } |