From 2849e21a59a93714defc023a09b185f93cf1e712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 16 Oct 2009 13:04:13 +0200 Subject: Fixed a crash in the tst_qgl test. QGLFramebuffer::isBound() would crash if it was called when there wasn't a current context bound. Reviewed-by: Kim --- src/opengl/qglframebufferobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 9674cfb..4fb8629 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1204,7 +1204,8 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const bool QGLFramebufferObject::isBound() const { Q_D(const QGLFramebufferObject); - return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo(); + const QGLContext *current = QGLContext::currentContext(); + return current ? current->d_ptr->current_fbo == d->fbo() : false; } /*! -- cgit v0.12