summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-03-18 13:34:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 08:35:24 +0100
commit07549de92bcb2e138c2f3c8d555092054a5359db (patch)
tree2d7a7f776726b0264faee93fcc1068ba6c0c5cfa /src/widgets
parent669588484fe4ee4ab1fddf39887d684d563b7450 (diff)
Delete the OpenGL context before the window.
Fix a crash-on-exit on Mac, where deleting the context references the attached NSView. Change-Id: Iac38184dab7a406e4072452fd9a6b175e6968ade Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 88a08060c1..85ae55b8ac 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -959,6 +959,8 @@ void QWidgetPrivate::deleteTLSysExtra()
#ifndef QT_NO_OPENGL
if (textureChildSeen && extra->topextra->shareContext)
extra->topextra->shareContext->doneCurrent();
+ delete extra->topextra->shareContext;
+ extra->topextra->shareContext = 0;
#endif
//the toplevel might have a context with a "qglcontext associated with it. We need to
@@ -972,10 +974,6 @@ void QWidgetPrivate::deleteTLSysExtra()
delete extra->topextra->window;
extra->topextra->window = 0;
-#ifndef QT_NO_OPENGL
- delete extra->topextra->shareContext;
- extra->topextra->shareContext = 0;
-#endif
}
}