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>
bb10
Liang Jian 2014-05-28 12:56:00 +08:00 committed by The Qt Project
parent 6e32a58428
commit 1d58face30
1 changed files with 3 additions and 1 deletions

View File

@ -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;