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 <sean.harmer@kdab.com>
This commit is contained in:
Tasuku Suzuki 2014-04-16 12:50:24 +09:00 committed by The Qt Project
parent 50b8506eac
commit cd21b56c9d

View File

@ -180,6 +180,10 @@ bool QOpenGLTexturePrivate::create()
void QOpenGLTexturePrivate::destroy() void QOpenGLTexturePrivate::destroy()
{ {
if (!context) {
// not created or already destroyed
return;
}
if (QOpenGLContext::currentContext() != context) { if (QOpenGLContext::currentContext() != context) {
qWarning("Requires a valid current OpenGL context.\n" qWarning("Requires a valid current OpenGL context.\n"
"Texture has not been destroyed"); "Texture has not been destroyed");