summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-16 15:53:10 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-16 16:03:42 (GMT)
commit4a0e3170c779a6a37954c3dfcfd0b9f0ce144701 (patch)
tree4ce0a56d99f079df6d593f66ef99b6691d901595
parent943290b3e72c9d9081ad95489a4319889e1a073a (diff)
downloadQt-4a0e3170c779a6a37954c3dfcfd0b9f0ce144701.zip
Qt-4a0e3170c779a6a37954c3dfcfd0b9f0ce144701.tar.gz
Qt-4a0e3170c779a6a37954c3dfcfd0b9f0ce144701.tar.bz2
Fixed crash in the Boxes demo when using -graphicssystem opengl.
QGLWindowSurface::flush() assumed that updateGeometry() had been called, but in some cases it hadn't. It would therefore dereference a null pointer and crash. This has been fixed by returning from flush() if updateGeometry() has not been called. This fixes the symptom rather than the bug, so we still need to find out why it hasn't been called. Reviewed-by: Trond
-rw-r--r--src/opengl/qwindowsurface_gl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 7f8577a..e6afed8 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -428,6 +428,12 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
return;
}
+ //### Find out why d_ptr->geometry_updated isn't always false.
+ // flush() should not be called when d_ptr->geometry_updated is true. It assumes that either
+ // d_ptr->fbo or d_ptr->pb is allocated and has the correct size.
+ if (d_ptr->geometry_updated)
+ return;
+
QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
Q_ASSERT(parent);