From: Paul Olav Tvete Date: Fri, 9 Sep 2011 13:03:01 +0000 (+0200) Subject: Make QSGItem::update() work when called from inside QSGCanvasPlainRenderLoop::paint() X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=29cdbc18fe0bed887c1c0192bd539802b39cf01b;p=konrad%2Fqtdeclarative.git Make QSGItem::update() work when called from inside QSGCanvasPlainRenderLoop::paint() If update was called in a function triggered by rendering, it would set the dirty flag without posting an update event. Subsequent render calls would just return without doing anything because the dirty flag was set. This could cause the applications UI to freeze up. Change-Id: Ib50403c1d9e22cc4680379f0c90fb2fcaa29c1d6 Reviewed-on: http://codereview.qt-project.org/4550 Reviewed-by: Samuel Rødal --- diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index b89a642..2f66368 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -91,6 +91,7 @@ public: } virtual void paint() { + updatePending = false; if (animationRunning && animationDriver()) animationDriver()->advance(); polishItems(); @@ -99,7 +100,6 @@ public: glViewport(0, 0, size.width(), size.height()); renderSceneGraph(size); swapBuffers(); - updatePending = false; if (animationRunning) maybeUpdate();