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>
This commit is contained in:
parent
715e9caf19
commit
c56e756aa9
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user