Clean up attribute arrays flags in OpenGL glyph cache
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Thu, 5 Jul 2012 13:21:56 +0000 (15:21 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Jul 2012 23:38:30 +0000 (01:38 +0200)
When used in the SceneGraph we're expected to disable the arrays
after we're done, otherwise we'll get a warning about memory corruption
and crashes.

Change-Id: Ie8e426309716bef4b75d79039e8ca0b4943c79e7
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
src/gui/opengl/qopengltextureglyphcache.cpp

index a57c605..9d160e6 100644 (file)
@@ -269,6 +269,9 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
     if (pex != 0) {
         glViewport(0, 0, pex->width, pex->height);
         pex->updateClipScissorTest();
+    } else {
+        m_blitProgram->disableAttributeArray(int(QT_VERTEX_COORDS_ATTR));
+        m_blitProgram->disableAttributeArray(int(QT_TEXTURE_COORDS_ATTR));
     }
 }