diff options
author | flow <flowlnlnln@gmail.com> | 2022-09-07 12:11:42 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-09-07 12:11:42 -0300 |
commit | 7cf2c3be0fe7495898675082e2e3f74c496683d4 (patch) | |
tree | 9e68d54946bedf00be8130ed1cf828bc28707bf3 /launcher/tasks | |
parent | f65d506f26fd8ba346646dc24ea6bca5e968d0c6 (diff) | |
download | PrismLauncher-7cf2c3be0fe7495898675082e2e3f74c496683d4.tar.gz PrismLauncher-7cf2c3be0fe7495898675082e2e3f74c496683d4.tar.bz2 PrismLauncher-7cf2c3be0fe7495898675082e2e3f74c496683d4.zip |
fix: start at least one task in ConcurrentTask
This allows us to emit all the necessary stuff when we're finished in
the case of starting a task with no subtasks. In particular, this caused
the mod updater to not work properly :)
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/tasks')
-rw-r--r-- | launcher/tasks/ConcurrentTask.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index 484ac58e..ce08a6a2 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -37,7 +37,8 @@ void ConcurrentTask::executeTask() { m_total_size = m_queue.size(); - int num_starts = std::min(m_total_max_size, m_total_size); + // Start the least amount of tasks needed, but at least one + int num_starts = std::max(1, std::min(m_total_max_size, m_total_size)); for (int i = 0; i < num_starts; i++) { QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection); } |