summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-07-29 13:32:02 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-07-29 13:32:02 (GMT)
commitd279a24b93b749ca27db39239f1eb03b4992eebb (patch)
treee6104ce31b898404d33a842cac3a52cdc207883d /src/opengl/qpixmapdata_gl.cpp
parent928eb3dee17f43d54262d1f3dfc5212f183e6ce9 (diff)
downloadQt-d279a24b93b749ca27db39239f1eb03b4992eebb.zip
Qt-d279a24b93b749ca27db39239f1eb03b4992eebb.tar.gz
Qt-d279a24b93b749ca27db39239f1eb03b4992eebb.tar.bz2
Fixed various valgrind-reported issues in GL 2 engine.
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index c0eed4d..f9d09b7 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -191,6 +191,8 @@ QGLPixmapData::~QGLPixmapData()
if (!shareWidget)
return;
+ delete m_engine;
+
if (m_texture.id) {
QGLShareContextScope ctx(shareWidget->context());
glDeleteTextures(1, &m_texture.id);
@@ -463,10 +465,8 @@ void QGLPixmapData::swapBuffers()
m_renderFbo->release();
qgl_fbo_pool()->release(m_renderFbo);
- delete m_engine;
m_renderFbo = 0;
- m_engine = 0;
}
void QGLPixmapData::makeCurrent()
@@ -493,7 +493,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const
if (!isValid())
return 0;
- if (m_engine)
+ if (m_renderFbo)
return m_engine;
if (useFramebufferObjects()) {
@@ -511,7 +511,8 @@ QPaintEngine* QGLPixmapData::paintEngine() const
m_renderFbo = qgl_fbo_pool()->acquire(size(), format);
if (m_renderFbo) {
- m_engine = new QGL2PaintEngineEx;
+ if (!m_engine)
+ m_engine = new QGL2PaintEngineEx;
return m_engine;
}