summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-30 11:56:45 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-01 07:10:34 +0200
commitc56e756aa9d58c6ebce9df2fb4f41ba94afc5b57 (patch)
treede8e8285a48ce19fa86f5df81f65ed62a5f842c0 /src
parent715e9caf19387649a42ba3a9706da41b332e4e5d (diff)
Reset pointer to 0 after freeing
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 <thiago.macieira@intel.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp4
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index b37e8fb972..790b92a686 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -106,8 +106,10 @@ void QOpenGLTextureGlyphCache::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 QOpenGLGlyphTexture(ctx);
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);