From a56cfad51a0ee5526536a6b2d4f3042ff8b00e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 10 Sep 2014 10:00:35 +0200 Subject: [PATCH] Destroy the QOpenGLTextureBlitter in the destructor if it has not already been destroyed Change-Id: If9a29da25eb23d5d65204eecabe095df215737ee Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltextureblitter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp index ebe0429290..24bdafed01 100644 --- a/src/gui/opengl/qopengltextureblitter.cpp +++ b/src/gui/opengl/qopengltextureblitter.cpp @@ -238,6 +238,7 @@ QOpenGLTextureBlitter::QOpenGLTextureBlitter() QOpenGLTextureBlitter::~QOpenGLTextureBlitter() { + destroy(); } bool QOpenGLTextureBlitter::create() @@ -303,6 +304,8 @@ bool QOpenGLTextureBlitter::isCreated() const void QOpenGLTextureBlitter::destroy() { + if (!isCreated()) + return; Q_D(QOpenGLTextureBlitter); d->program.reset(); d->vertexBuffer.destroy();