diff options
-rw-r--r-- | src/gui/opengl/qopengltexture.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 766d4a327a..4d0ba212ab 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -190,11 +190,20 @@ void QOpenGLTexturePrivate::destroy() return; } QOpenGLContext *currentContext = QOpenGLContext::currentContext(); - if (!currentContext || !QOpenGLContext::areSharing(currentContext, context)) { - qWarning("Texture is not valid in the current context.\n" + if (!currentContext) { + qWarning("QOpenGLTexturePrivate::destroy() called without a current context.\n" "Texture has not been destroyed"); return; } + if (!QOpenGLContext::areSharing(currentContext, context)) { + + qWarning("QOpenGLTexturePrivate::destroy() called but texture context %p" + " is not shared with current context %p.\n" + "Texture has not been destroyed", + static_cast<const void *>(context), + static_cast<const void *>(currentContext)); + return; + } functions->glDeleteTextures(1, &textureId); |