mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-24 07:55:35 +08:00
T66 A new smart pointer for managing a CContinuousWorker subclass instance.
Owns the worker before it starts, when ownership is transferred to the thread.
This commit is contained in:
@@ -56,6 +56,7 @@ namespace BlackMisc
|
||||
CWorker *CWorker::fromTaskImpl(QObject *owner, const QString &name, int typeId, std::function<CVariant()> task)
|
||||
{
|
||||
auto *worker = new CWorker(task);
|
||||
emit worker->aboutToStart();
|
||||
worker->setStarted();
|
||||
auto *thread = new CRegularThread(owner);
|
||||
|
||||
@@ -122,6 +123,7 @@ namespace BlackMisc
|
||||
|
||||
if (m_name.isEmpty()) { m_name = metaObject()->className(); }
|
||||
|
||||
emit aboutToStart();
|
||||
setStarted();
|
||||
auto *thread = new CRegularThread(m_owner);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user