Don't delete thread in LambdaThread until destructor

* This means a non-self deleting thread can be waited for or queried about still
  after it's completed.
This commit is contained in:
baldurk
2020-09-04 18:34:18 +01:00
parent a0eadf47f5
commit ecd23041a4
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -338,7 +338,6 @@ public slots:
windowsSetName();
m_func();
m_Thread->quit();
m_Thread = NULL;
if(m_SelfDelete)
deleteLater();
completed.acquire();
@@ -353,9 +352,9 @@ 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);
}
~LambdaThread() { m_Thread->deleteLater(); }
void setName(QString name)
{
m_Name = name;
+1 -1
View File
@@ -589,8 +589,8 @@ void CaptureDialog::CheckAndroidSetup(QString &filename)
});
scan->setName(lit("CheckAndroidSetup"));
scan->selfDelete(true);
scan->start();
scan->deleteLater();
}
void CaptureDialog::androidWarn_mouseClick()