summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-02-17 11:39:25 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-25 16:01:22 +0100
commit72ba4cd3858773757d3cc5a66f7859a483b6475b (patch)
tree7e4355b40babbc08ba15389762ca829fac883867 /src/plugins
parentf2ade01f4c0c33e070d89b473b4c0037aed9e7f3 (diff)
Cocoa: Clear GL context pointer on deletion.
The QGLWidget destructor sequence is such that the GL context will be deleted before the window is hidden. This would leave QCocoaWindow with a stale m_glContext pointer. Clear QCocoaWindow's context pointer on context deletion. Task-number: QTBUG-36820 Change-Id: I710e3813f9ce90ddd37ad7b406693f0c58a1436d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 6f76892d93..9b4d8fd96f 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -162,6 +162,9 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo
QCocoaGLContext::~QCocoaGLContext()
{
+ if (m_currentWindow && m_currentWindow.data()->handle())
+ static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(0);
+
[m_context release];
}