diff options
author | flow <flowlnlnln@gmail.com> | 2022-07-22 00:28:08 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-08-28 16:29:00 -0300 |
commit | 369a8cdc7497d7bc335b660ac6c14652abe8fde7 (patch) | |
tree | 8cafc2e523bfd0da8b7c8f3aac3eed90e968abd9 /launcher/tasks | |
parent | 9171f471abc4d61079a9fe2bda10801bded100e9 (diff) | |
download | PrismLauncher-369a8cdc7497d7bc335b660ac6c14652abe8fde7.tar.gz PrismLauncher-369a8cdc7497d7bc335b660ac6c14652abe8fde7.tar.bz2 PrismLauncher-369a8cdc7497d7bc335b660ac6c14652abe8fde7.zip |
fix: only try to start tasks that are really there
This fixes an annoying issue where concurrent tasks would try to start
multiple tasks even when there was not that many tasks to run in the
first place, causing some amount of log spam.
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 ab7cbd03..2af296b9 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -37,7 +37,8 @@ void ConcurrentTask::executeTask() { m_total_size = m_queue.size(); - for (int i = 0; i < m_total_max_size; i++) { + int num_starts = std::min(m_total_max_size, m_total_size); + for (int i = 0; i < num_starts; i++) { QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection); } } |