From 26a18e5d03310dc69bfe97bac1ff512b3d62c475 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 22 Jun 2011 18:11:06 +1000 Subject: [PATCH] Correctly wait for render thread to exit --- src/declarative/items/qsgcanvas.cpp | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 0500b75..97d643d 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(); } -- 1.7.2.5