From b1c0c0bf169d4ab83ce6e9b1b333e99610aa6f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 26 Mar 2009 10:14:07 +0100 Subject: Ensure we don't access the GL share widget when it's being destroyed. Zero the pointer before destroying the widget, as QGLWidget's destructor may indirectly trigger access to the share widget. --- src/opengl/qwindowsurface_gl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index b4a4565..bed08cf 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -187,9 +187,10 @@ public: } void cleanup() { - delete widget; - widget = 0; + QGLWidget *w = widget; cleanedUp = true; + widget = 0; + delete w; } static bool cleanedUp; -- cgit v0.12