From f45adb8cc5381bf726c0c177e004cf3b8db80daa Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 9 Feb 2017 16:26:51 +0000 Subject: [PATCH] In LambdaThread delete QThread on finished signal instead of during run --- qrenderdoc/Code/QRDUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qrenderdoc/Code/QRDUtils.h b/qrenderdoc/Code/QRDUtils.h index 518babbc9..396a9a8b9 100644 --- a/qrenderdoc/Code/QRDUtils.h +++ b/qrenderdoc/Code/QRDUtils.h @@ -535,7 +535,6 @@ public slots: { m_func(); m_Thread->quit(); - m_Thread->deleteLater(); m_Thread = NULL; if(m_SelfDelete) deleteLater(); @@ -551,6 +550,7 @@ public: m_func = f; moveToThread(m_Thread); QObject::connect(m_Thread, &QThread::started, this, &LambdaThread::process); + QObject::connect(m_Thread, &QThread::finished, m_Thread, &QThread::deleteLater); } void start(QThread::Priority prio = QThread::InheritPriority) { m_Thread->start(prio); }