T102 Fixed mistake that caused CWorkerPointer to delete the worker

immediately as soon as it starts.
This commit is contained in:
Mathew Sutcliffe
2017-07-04 23:08:21 +01:00
parent fdbfda848f
commit a37b12c8bc

View File

@@ -329,7 +329,7 @@ namespace BlackMisc
{ {
if (!ptr || static_cast<const CContinuousWorker *>(ptr)->hasStarted()) { return; } if (!ptr || static_cast<const CContinuousWorker *>(ptr)->hasStarted()) { return; }
m_strong.reset(ptr); m_strong.reset(ptr);
QObject::connect(ptr, &CWorkerBase::aboutToStart, [this] { m_strong.reset(); }); QObject::connect(ptr, &CWorkerBase::aboutToStart, [this] { m_strong.release(); });
} }
//! Construct a null pointer. //! Construct a null pointer.