diff options
author | Jani Hautakangas <jani.hautakangas@nokia.com> | 2011-11-30 12:41:39 (GMT) |
---|---|---|
committer | Jani Hautakangas <jani.hautakangas@nokia.com> | 2011-11-30 13:23:47 (GMT) |
commit | 8752faf0564bed86396b01529dc8ef5064150f4c (patch) | |
tree | c398d5b2b7ad4af203ffeef1f89a994e54804ac8 /src/opengl/qgltexturepool.cpp | |
parent | 9a5fb6bd5f0fb3b37897bf722e4cc1673309623c (diff) | |
download | Qt-8752faf0564bed86396b01529dc8ef5064150f4c.zip Qt-8752faf0564bed86396b01529dc8ef5064150f4c.tar.gz Qt-8752faf0564bed86396b01529dc8ef5064150f4c.tar.bz2 |
Fix memory leaks in OpenVG and OpenGL resource pools
Task-number: QTBUG-22743
Reviewed-by: Murray Read
Diffstat (limited to 'src/opengl/qgltexturepool.cpp')
-rw-r--r-- | src/opengl/qgltexturepool.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp index 9ad66f2..d19b1db 100644 --- a/src/opengl/qgltexturepool.cpp +++ b/src/opengl/qgltexturepool.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE Q_OPENGL_EXPORT extern QGLWidget* qt_gl_share_widget(); -static QGLTexturePool *qt_gl_texture_pool = 0; +Q_GLOBAL_STATIC(QGLTexturePool, qt_gl_texture_pool) class QGLTexturePoolPrivate { @@ -69,9 +69,7 @@ QGLTexturePool::~QGLTexturePool() QGLTexturePool *QGLTexturePool::instance() { - if (!qt_gl_texture_pool) - qt_gl_texture_pool = new QGLTexturePool(); - return qt_gl_texture_pool; + return qt_gl_texture_pool(); } GLuint QGLTexturePool::createTexture(GLenum target, |