From 6a8a93a2a19dd4eaf649b6384be8986c201406f5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 11 May 2017 13:49:01 +0200 Subject: [PATCH] QOpenGLTexturePrivate::destroy(): Make error messages more verbose Distinguish missing and non-sharing contexts, output values. Change-Id: If52555098c1b46e6016e00f9dbbfad8e4b5d3a2d Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltexture.cpp | 13 +++++++++++-- 1 file 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(context), + static_cast(currentContext)); + return; + } functions->glDeleteTextures(1, &textureId);