From 26a18e5d03310dc69bfe97bac1ff512b3d62c475 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 22 Jun 2011 18:11:06 +1000 Subject: Correctly wait for render thread to exit --- src/declarative/items/qsgcanvas.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 0500b752c7..97d643dae6 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -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(); } -- cgit v1.2.3