This commit is contained in:
Nav
2023-03-13 00:45:26 +00:00
parent c394ce52df
commit 4895b2c919
11 changed files with 98 additions and 61 deletions

View File

@@ -33,16 +33,15 @@ namespace Bloom
emit this->ready();
}
void InsightWorker::queueTask(InsightWorkerTask* task) {
const auto taskPtr = QSharedPointer<InsightWorkerTask>(task, &QObject::deleteLater);
taskPtr->moveToThread(nullptr);
void InsightWorker::queueTask(const QSharedPointer<InsightWorkerTask>& task) {
task->moveToThread(nullptr);
{
const auto taskQueueLock = InsightWorker::queuedTasksById.acquireLock();
InsightWorker::queuedTasksById.getValue().emplace(taskPtr->id, taskPtr);
InsightWorker::queuedTasksById.getValue().emplace(task->id, task);
}
emit InsightSignals::instance()->taskQueued(taskPtr);
emit InsightSignals::instance()->taskQueued(task);
}
void InsightWorker::executeTasks() {