summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_egl.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-03-11 14:44:08 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-11 14:51:57 (GMT)
commitfc0e0198c5e7ef75d1650bca39a5f06ebddfb932 (patch)
treec0b1fb6e5f8349fb4bde83fc568775aaff2990d6 /src/opengl/qgl_egl.cpp
parent82fa80a6b28ea5a4d3e245f531fea22a689c7ad3 (diff)
downloadQt-fc0e0198c5e7ef75d1650bca39a5f06ebddfb932.zip
Qt-fc0e0198c5e7ef75d1650bca39a5f06ebddfb932.tar.gz
Qt-fc0e0198c5e7ef75d1650bca39a5f06ebddfb932.tar.bz2
Delete the QGLContext in ~QX11GLPixmapData
This also includes changes which allow QGLContext to not own it's own QEglContext. With X11GL, the QEglContext gets reused by multiple QGLContexts so it is important QGLContext doesn't delete it. Reviewed-By: TrustMe
Diffstat (limited to 'src/opengl/qgl_egl.cpp')
-rw-r--r--src/opengl/qgl_egl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index c08d6fd..aa8d2bc 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -164,10 +164,11 @@ void QGLContext::reset()
return;
d->cleanup();
doneCurrent();
- if (d->eglContext) {
+ if (d->eglContext && d->ownsEglContext) {
d->destroyEglSurfaceForDevice();
delete d->eglContext;
}
+ d->ownsEglContext = false;
d->eglContext = 0;
d->eglSurface = EGL_NO_SURFACE;
d->crWin = false;
@@ -215,7 +216,7 @@ void QGLContextPrivate::destroyEglSurfaceForDevice()
#ifdef Q_WS_X11
// Make sure we don't call eglDestroySurface on a surface which
// was created for a different winId:
- if (paintDevice->devType() == QInternal::Widget) {
+ if (paintDevice && paintDevice->devType() == QInternal::Widget) {
QGLWidget* w = static_cast<QGLWidget*>(paintDevice);
if (w->d_func()->eglSurfaceWindowId == w->winId())