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>
This commit is contained in:
Morten Johan Sørvig 2014-03-18 13:34:00 +01:00 committed by The Qt Project
parent 669588484f
commit 07549de92b

View File

@ -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
}
}