ProgressView: Also replace old tasks that are canceling

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>
This commit is contained in:
dt_
2011-06-09 13:18:39 +02:00
committed by Daniel Teske
parent f38b0e7bd8
commit 57d1598d2c

View File

@@ -88,7 +88,7 @@ void ProgressView::removeOldTasks(const QString &type, bool keepOne)
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);
}