summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-11-16 12:19:29 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-11-17 14:00:48 (GMT)
commit78895a7ecaf6579894d88388c09be6e6368dc029 (patch)
tree5cf81a6e70cd521745af46822599201f908f555b
parent6ad33e1ff7618704fd41549780d0d0c93778364e (diff)
downloadQt-78895a7ecaf6579894d88388c09be6e6368dc029.zip
Qt-78895a7ecaf6579894d88388c09be6e6368dc029.tar.gz
Qt-78895a7ecaf6579894d88388c09be6e6368dc029.tar.bz2
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
-rw-r--r--src/opengl/qgl_p.h3
1 files changed, 2 insertions, 1 deletions
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