From 78895a7ecaf6579894d88388c09be6e6368dc029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 16 Nov 2010 14:19:29 +0200 Subject: Fixed crash when destroying QGLWidget The QGLWidget destroys the QGLContext, which in turn destroys the bound pixmap. When this happens there may not be a current QGLContext, so check that before trying to restore it. Done-with: Gunnar Sletta Reviewed-by: Samuel --- src/opengl/qgl_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 4742bdb..b46d428 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -506,7 +506,8 @@ private slots: // when you come to delete the context. QGLContextPrivate::unbindPixmapFromTexture(boundPixmap); glDeleteTextures(1, &id); - oldContext->makeCurrent(); + if (oldContext) + oldContext->makeCurrent(); return; } #endif -- cgit v0.12