OSDN Git Service

ProgressView: Also replace old tasks that are canceling
authordt_ <qtc-committer@nokia.com>
Thu, 9 Jun 2011 11:18:39 +0000 (13:18 +0200)
committerDaniel Teske <daniel.teske@nokia.com>
Thu, 9 Jun 2011 12:25:38 +0000 (14:25 +0200)
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>
src/plugins/coreplugin/progressmanager/progressview.cpp

index e669551..40257e0 100644 (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);
             }