Those tasks might not have finished yet, so there's a small race when
canceling and restarting a task.
Change-Id: I9f9ffcc6869455e7d8a407ff6ff4c40518d60f27
Task-Nr: QTCREATORBUG-4801
Reviewed-on: http://codereview.qt.nokia.com/419
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
while (i != m_taskList.begin()) {
--i;
if ((*i)->type() == type) {
- if (firstFound && (*i)->future().isFinished()) {
+ if (firstFound && ((*i)->future().isFinished() || (*i)->future().isCanceled())) {
deleteTask(*i);
i = m_taskList.erase(i);
}