summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglframebufferobject.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-28 18:10:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-02 10:06:07 +0200
commitb94493e6c86d9744f9fe224bedd79daa188286c1 (patch)
treee28a3e52fd9f6b8e978aa30ad379883f162bf15a /src/gui/opengl/qopenglframebufferobject.cpp
parentf7971d37cbc7e2f25d0fac382f33f3c270c10598 (diff)
Avoid an "OpenGL Error: 1282" output when resizing a QOpenGLWidget
When we delete the previous FBO in QOpenGLWidget::resizeEvent while it is the currently bound FBO, the QOpenGLContextPrivate::current_fbo will not be updated and will try to be bound during the initialization of the new FBO. Fix the issue by explicitly releasing the FBO on destruction if it is current. Change-Id: Id049889c4857526750bbecf3dd27343e44449c12 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 55edaf7baf..92a7330d6c 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -890,6 +890,8 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(const QSize &size, Attachment
QOpenGLFramebufferObject::~QOpenGLFramebufferObject()
{
Q_D(QOpenGLFramebufferObject);
+ if (isBound())
+ release();
if (d->texture_guard)
d->texture_guard->free();