Correctly wait for render thread to exit
authorAaron Kennedy <aaron.kennedy@nokia.com>
Wed, 22 Jun 2011 08:11:06 +0000 (18:11 +1000)
committerAaron Kennedy <aaron.kennedy@nokia.com>
Wed, 22 Jun 2011 08:11:06 +0000 (18:11 +1000)
src/declarative/items/qsgcanvas.cpp

index 0500b75..97d643d 100644 (file)
@@ -2316,6 +2316,13 @@ void QSGCanvasRenderThread::stopRenderThread()
     }
 
     unlockInGui();
+
+#ifdef THREAD_DEBUG
+    printf("GUI: waiting for render thread to terminate..\n");
+#endif
+    // Actually wait for the thread to terminate.  Otherwise we can delete it
+    // too early and crash.
+    QThread::wait();
 }