forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user