summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgltexturepool.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-12-12 13:10:28 (GMT)
committermread <qt-info@nokia.com>2011-12-12 13:38:57 (GMT)
commit09449825551798a09c2bf18daea18e8e2abe93bc (patch)
treee3d6cb9d8209ebcf9d84b320fb627e86f5987878 /src/opengl/qgltexturepool.cpp
parent54613aec3bdac668d198923814873a9e622ad675 (diff)
downloadQt-09449825551798a09c2bf18daea18e8e2abe93bc.zip
Qt-09449825551798a09c2bf18daea18e8e2abe93bc.tar.gz
Qt-09449825551798a09c2bf18daea18e8e2abe93bc.tar.bz2
Revert "Fix memory leaks in OpenVG and OpenGL resource pools"
This reverts commit 8752faf0564bed86396b01529dc8ef5064150f4c. Also Revert "Fix def files" This reverts commit d2a3b9ee8c9329cac96b5e509df0e6a69dbef91c. This was found to cause a crash in QMLGallery app. It is not necessary to delete these resource pools at app exit, as the OS should automatically release the resources at this point. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/opengl/qgltexturepool.cpp')
-rw-r--r--src/opengl/qgltexturepool.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp
index d19b1db..9ad66f2 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();
-Q_GLOBAL_STATIC(QGLTexturePool, qt_gl_texture_pool)
+static QGLTexturePool *qt_gl_texture_pool = 0;
class QGLTexturePoolPrivate
{
@@ -69,7 +69,9 @@ QGLTexturePool::~QGLTexturePool()
QGLTexturePool *QGLTexturePool::instance()
{
- return qt_gl_texture_pool();
+ if (!qt_gl_texture_pool)
+ qt_gl_texture_pool = new QGLTexturePool();
+ return qt_gl_texture_pool;
}
GLuint QGLTexturePool::createTexture(GLenum target,