summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_egl.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-30 04:34:21 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-30 04:34:21 (GMT)
commitb125af1b298d694c332f56deebe4755d0c985d5d (patch)
tree85ade719ba12ff5f83fa73acb3b141fae7cc23eb /src/opengl/qgl_egl.cpp
parent977c3ce728592ffc0aba92e6818d010a9f350120 (diff)
downloadQt-b125af1b298d694c332f56deebe4755d0c985d5d.zip
Qt-b125af1b298d694c332f56deebe4755d0c985d5d.tar.gz
Qt-b125af1b298d694c332f56deebe4755d0c985d5d.tar.bz2
Fix a memory leak of EGLSurface's in QGLContext
Reviewed-by: Julian de Bhal
Diffstat (limited to 'src/opengl/qgl_egl.cpp')
-rw-r--r--src/opengl/qgl_egl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 5ce1a45..6c93bea 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -142,10 +142,12 @@ void QGLContext::reset()
d->cleanup();
doneCurrent();
if (d->eglContext) {
+ if (d->eglSurface != EGL_NO_SURFACE)
+ eglDestroySurface(d->eglContext->display(), d->eglSurface);
delete d->eglContext;
- d->eglContext = 0;
}
- d->eglSurface = EGL_NO_SURFACE; // XXX - probably need to destroy surface
+ d->eglContext = 0;
+ d->eglSurface = EGL_NO_SURFACE;
d->crWin = false;
d->sharing = false;
d->valid = false;