summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 66445cd..1b879c3 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -83,13 +83,9 @@ void QGLTextureGlyphCache::clear()
if (ctx) {
QGLShareContextScope scope(ctx);
- if (!ctx->d_ptr->workaround_brokenFBOReadBack)
- glDeleteFramebuffers(1, &m_fbo);
-
if (m_width || m_height)
glDeleteTextures(1, &m_texture);
- m_fbo = 0;
m_texture = 0;
m_width = 0;
m_height = 0;
@@ -105,6 +101,13 @@ void QGLTextureGlyphCache::clear()
QGLTextureGlyphCache::~QGLTextureGlyphCache()
{
+ if (ctx) {
+ QGLShareContextScope scope(ctx);
+
+ if (!ctx->d_ptr->workaround_brokenFBOReadBack)
+ glDeleteFramebuffers(1, &m_fbo);
+ }
+
clear();
}