diff options
author | Liang Jian <jianliang79@gmail.com> | 2014-05-28 12:56:00 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-28 08:26:03 +0200 |
commit | 1d58face30c2936657c4372c6237e2fe64e4095b (patch) | |
tree | 9e2c45a577f2542fa9ee765cc94c5783fd6bc0bd /src | |
parent | 6e32a58428fc0cf95dd3c7cae6286be5ce44a833 (diff) |
Fix QOpenGLGlyphTexture object leak
Call clear() in the destructor of QOpenGLTextureGlyphCache class to
prevent QOpenGLGlyphTexture object leak.
Change-Id: I290b09b0786d30603391e6855a21e9232b112739
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/opengl/qopengltextureglyphcache.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp index f721d5cb8c..0610ab60ed 100644 --- a/src/gui/opengl/qopengltextureglyphcache.cpp +++ b/src/gui/opengl/qopengltextureglyphcache.cpp @@ -87,6 +87,7 @@ QOpenGLTextureGlyphCache::~QOpenGLTextureGlyphCache() #ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG qDebug(" -> ~QOpenGLTextureGlyphCache() %p.", this); #endif + clear(); } static inline bool isCoreProfile() @@ -447,7 +448,8 @@ int QOpenGLTextureGlyphCache::maxTextureHeight() const void QOpenGLTextureGlyphCache::clear() { - m_textureResource->free(); + if (m_textureResource) + m_textureResource->free(); m_textureResource = 0; m_w = 0; |