fix: better handle corner case

This commit is contained in:
flow 2022-05-24 20:19:31 -03:00
parent 166f872712
commit f8e7fb3d48
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -34,6 +34,11 @@ void SequentialTask::executeTask()
bool SequentialTask::abort() bool SequentialTask::abort()
{ {
if(m_currentIndex == -1 || m_currentIndex >= m_queue.size()) { if(m_currentIndex == -1 || m_currentIndex >= m_queue.size()) {
if(m_currentIndex == -1) {
// Don't call emitAborted() here, we want to bypass the 'is the task running' check
emit aborted();
emit finished();
}
m_queue.clear(); m_queue.clear();
return true; return true;
} }