From cd21b56c9dbb078828c86a5a073f13074b1645d2 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 16 Apr 2014 12:50:24 +0900 Subject: [PATCH] remove context unmatched warning in QOpenGLTexture destroy() or destructor complain when QOpenGLTexture is not created or it is already destroyed. Change-Id: I6b3135849e3ba2ce35678fcdbf1c9b6e588a063c Reviewed-by: Sean Harmer --- src/gui/opengl/qopengltexture.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 078274eabd..51d35cbd59 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -180,6 +180,10 @@ bool QOpenGLTexturePrivate::create() void QOpenGLTexturePrivate::destroy() { + if (!context) { + // not created or already destroyed + return; + } if (QOpenGLContext::currentContext() != context) { qWarning("Requires a valid current OpenGL context.\n" "Texture has not been destroyed");