From c56e756aa9d58c6ebce9df2fb4f41ba94afc5b57 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 30 Apr 2012 11:56:45 +0200 Subject: Reset pointer to 0 after freeing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set m_textureResource to 0 after freeing it, to ensure we allocate a new one two lines below before using it again 5 lines below. Change-Id: Ib9c4de94aefed91f15d0fab0cd3c774a64f2f891 Reviewed-by: Thiago Macieira Reviewed-by: Samuel Rødal --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/opengl/gl2paintengineex') diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index c12a83a61e..8321b8dafe 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -105,8 +105,10 @@ void QGLTextureGlyphCache::createTextureData(int width, int height) if (height < 16) height = 16; - if (m_textureResource && !m_textureResource->m_texture) + if (m_textureResource && !m_textureResource->m_texture) { delete m_textureResource; + m_textureResource = 0; + } if (!m_textureResource) m_textureResource = new QGLGlyphTexture(ctx); -- cgit v1.2.3