Fixed assert during QML shutdown
authorGunnar Sletta <gunnar.sletta@nokia.com>
Mon, 14 Nov 2011 14:11:45 +0000 (15:11 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 14 Nov 2011 15:39:25 +0000 (16:39 +0100)
Change-Id: I680af9ccb417d3162277b5740a129ecd77feee7f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/declarative/items/qquickcanvas.cpp

index dfdaaed..d5003e9 100644 (file)
@@ -864,6 +864,12 @@ QQuickCanvas::~QQuickCanvas()
 {
     Q_D(QQuickCanvas);
 
 {
     Q_D(QQuickCanvas);
 
+    /* The threaded renderer will clean up the nodes which will fire
+       sceneGraphChanged events through back to the canvas. This signal
+       is connected to maybeUpdate which should only be called from GUI or during
+       updatePaintNode(), so disconnect them before starting the shutdown
+     */
+    disconnect(d->context->renderer(), SIGNAL(sceneGraphChanged()), this, SLOT(maybeUpdate()));
     if (d->thread->isRunning()) {
         d->thread->stopRendering();
         delete d->thread;
     if (d->thread->isRunning()) {
         d->thread->stopRendering();
         delete d->thread;