GUI render loop did not render on expose, nor clean up properly.
authorGunnar Sletta <gunnar.sletta@digia.com>
Mon, 18 Feb 2013 08:45:24 +0000 (09:45 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 18 Feb 2013 09:39:20 +0000 (10:39 +0100)
Change-Id: I6f9ab43ad6d149295487d9f69ceb0131cd142776
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/quick/scenegraph/qsgrenderloop.cpp

index 9117b2c..83e8d3f 100644 (file)
@@ -194,15 +194,24 @@ void QSGGuiThreadRenderLoop::hide(QQuickWindow *window)
     cd->cleanupNodesOnShutdown();
 
     if (m_windows.size() == 0) {
-        sg->invalidate();
-        delete gl;
-        gl = 0;
+        if (!cd->persistentSceneGraph) {
+            sg->invalidate();
+            if (!cd->persistentGLContext) {
+                delete gl;
+                gl = 0;
+            }
+        }
     }
 }
 
 void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
 {
     hide(window);
+    if (m_windows.size() == 0) {
+        sg->invalidate();
+        delete gl;
+        gl = 0;
+    }
 }
 
 void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
@@ -297,7 +306,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
 void QSGGuiThreadRenderLoop::exposureChanged(QQuickWindow *window)
 {
     if (window->isExposed())
-        maybeUpdate(window);
+        renderWindow(window);
 }
 
 QImage QSGGuiThreadRenderLoop::grab(QQuickWindow *window)