Commit 1d58face authored by Liang Jian's avatar Liang Jian Committed by The Qt Project
Browse files

Fix QOpenGLGlyphTexture object leak


Call clear() in the destructor of QOpenGLTextureGlyphCache class to
prevent QOpenGLGlyphTexture object leak.

Change-Id: I290b09b0786d30603391e6855a21e9232b112739
Reviewed-by: default avatarGunnar Sletta <gunnar.sletta@jollamobile.com>
parent 6e32a584
Branches
Tags
No related merge requests found
Showing with 3 additions and 1 deletion
......@@ -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;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment