Cleanup SG properly in QQuickCanvas
authorAlan Alpert <alan.alpert@nokia.com>
Mon, 18 Jun 2012 04:08:55 +0000 (14:08 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 08:27:30 +0000 (10:27 +0200)
The scenegraph renderer and root node were not cleaned up when all other
SG nodes are. This leads to a possible case where the SG nodes
regenerate for the canvas without being properly linked to the renderer.

Task-number: QTBUG-23571
Change-Id: I19084af998cb7482bfddc87770ee9b5e0aad3a6c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/quick/items/qquickcanvas.cpp

index f105944..3cd8943 100644 (file)
@@ -1836,11 +1836,13 @@ void QQuickCanvasPrivate::cleanupNodesOnShutdown(QQuickItem *item)
 // This must be called from the render thread, with the main thread frozen
 void QQuickCanvasPrivate::cleanupNodesOnShutdown()
 {
+    Q_Q(QQuickCanvas);
     cleanupNodes();
     cleanupNodesOnShutdown(rootItem);
     QSet<QQuickItem *>::const_iterator it = parentlessItems.begin();
     for (; it != parentlessItems.end(); ++it)
         cleanupNodesOnShutdown(*it);
+    q->cleanupSceneGraph();
 }
 
 void QQuickCanvasPrivate::updateDirtyNodes()