summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-10-16 11:04:13 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-10-16 11:05:08 (GMT)
commit2849e21a59a93714defc023a09b185f93cf1e712 (patch)
treedba0f7efa0b6e84f6b80c4ba770856e117bb14bc /src/opengl/qglframebufferobject.cpp
parentb5106b1b99a749653c58719c333411b9ce374b67 (diff)
downloadQt-2849e21a59a93714defc023a09b185f93cf1e712.zip
Qt-2849e21a59a93714defc023a09b185f93cf1e712.tar.gz
Qt-2849e21a59a93714defc023a09b185f93cf1e712.tar.bz2
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
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r--src/opengl/qglframebufferobject.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}
/*!