In LambdaThread delete QThread on finished signal instead of during run

This commit is contained in:
baldurk
2017-02-09 16:26:51 +00:00
parent 913554c005
commit f45adb8cc5
+1 -1
View File
@@ -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); }