From 4a0e3170c779a6a37954c3dfcfd0b9f0ce144701 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 16 Oct 2009 17:53:10 +0200 Subject: 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 --- src/opengl/qwindowsurface_gl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v0.12