diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-02 09:13:30 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-19 12:56:37 (GMT) |
commit | e2296ba010100d007a081e0faac8066adbeb7137 (patch) | |
tree | c5425000cda1b560aa842f015d060537495a4491 /src/gui/egl | |
parent | 4d94420184fa109286a9e4233010d5d7539a35a4 (diff) | |
download | Qt-e2296ba010100d007a081e0faac8066adbeb7137.zip Qt-e2296ba010100d007a081e0faac8066adbeb7137.tar.gz Qt-e2296ba010100d007a081e0faac8066adbeb7137.tar.bz2 |
Stop QEglContext destroying contexts it doesn't own
Reviewed-By: Rhys Weatherley
Diffstat (limited to 'src/gui/egl')
-rw-r--r-- | src/gui/egl/qegl.cpp | 3 | ||||
-rw-r--r-- | src/gui/egl/qegl_p.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index 840b9d6..39291d3 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -61,6 +61,7 @@ QEglContext::QEglContext() , cfg(0) , currentSurface(EGL_NO_SURFACE) , current(false) + , ownsContext(true) { } @@ -206,7 +207,7 @@ void QEglContext::destroySurface(EGLSurface surface) // Destroy the context. Note: this does not destroy the surface. void QEglContext::destroy() { - if (ctx != EGL_NO_CONTEXT) + if (ctx != EGL_NO_CONTEXT && ownsContext) eglDestroyContext(dpy, ctx); dpy = EGL_NO_DISPLAY; ctx = EGL_NO_CONTEXT; diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index dc399da..16b5b16 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -110,7 +110,7 @@ public: EGLDisplay display() const { return dpy; } EGLContext context() const { return ctx; } - void setContext(EGLContext context) { ctx = context; } + void setContext(EGLContext context) { ctx = context; ownsContext = false;} EGLConfig config() const { return cfg; } void setConfig(EGLConfig config) { cfg = config; } @@ -131,6 +131,7 @@ private: EGLConfig cfg; EGLSurface currentSurface; bool current; + bool ownsContext; static EGLDisplay getDisplay(QPaintDevice *device); |