diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 20712a9d79d..f3ff09161cb 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -485,10 +485,15 @@ void DocumentModelPrivate::removeAllSuspendedEntries(PinnedFileRemovalPolicy pin if (pinnedFileRemovalPolicy == DoNotRemovePinnedFiles && entry->pinned) continue; + const FilePath fixedPath = DocumentManager::filePathKey(entry->fileName(), + DocumentManager::ResolveLinks); int row = i + 1/**/; d->beginRemoveRows(QModelIndex(), row, row); delete d->m_entries.takeAt(i); d->endRemoveRows(); + + if (!fixedPath.isEmpty()) + d->m_entryByFixedPath.remove(fixedPath); } QSet displayNames; for (DocumentModel::Entry *entry : qAsConst(d->m_entries)) {