From b94493e6c86d9744f9fe224bedd79daa188286c1 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 28 Mar 2014 18:10:52 +0100 Subject: 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 --- src/gui/opengl/qopenglframebufferobject.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(); -- cgit v1.2.3