diff options
author | flow <flowlnlnln@gmail.com> | 2023-01-17 16:08:50 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2023-01-18 16:23:30 -0300 |
commit | 00d42d296e6519c92716d377496ba48c348c95b3 (patch) | |
tree | ac25a8abe5880a4114a0c902331304a5811b799c /launcher/tasks/ConcurrentTask.cpp | |
parent | ad74fedfba45fe0f36ff387e586b21d4ede8ca83 (diff) | |
download | PrismLauncher-00d42d296e6519c92716d377496ba48c348c95b3.tar.gz PrismLauncher-00d42d296e6519c92716d377496ba48c348c95b3.tar.bz2 PrismLauncher-00d42d296e6519c92716d377496ba48c348c95b3.zip |
fix: call processEvents() before adding new tasks to the task queue
This allows the ongoing task to go off the stack before the next one is
started.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/tasks/ConcurrentTask.cpp')
-rw-r--r-- | launcher/tasks/ConcurrentTask.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index a890013e..190d48d8 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -110,14 +110,14 @@ void ConcurrentTask::startNext() setStepStatus(next->isMultiStep() ? next->getStepStatus() : next->getStatus()); updateState(); + QCoreApplication::processEvents(); + QMetaObject::invokeMethod(next.get(), &Task::start, Qt::QueuedConnection); // Allow going up the number of concurrent tasks in case of tasks being added in the middle of a running task. int num_starts = m_total_max_size - m_doing.size(); for (int i = 0; i < num_starts; i++) QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection); - - QCoreApplication::processEvents(); } void ConcurrentTask::subTaskSucceeded(Task::Ptr task) |