Skip to content
Snippets Groups Projects
Commit d19ca58b authored by dt's avatar dt
Browse files

Fix crash with removing files in symlinked directories

Reviewed-By: thorbjorn

Task-Nr: QTCREATORBUG-965
parent b6736939
No related branches found
No related tags found
No related merge requests found
...@@ -273,13 +273,18 @@ void FileManager::removeFileInfo(IFile *file) ...@@ -273,13 +273,18 @@ void FileManager::removeFileInfo(IFile *file)
void FileManager::removeFileInfo(const QString &fileName, IFile *file) void FileManager::removeFileInfo(const QString &fileName, IFile *file)
{ {
const QString &fixedName = fixFileName(fileName); const QString &fixedName = fixFileName(fileName);
d->m_states[fixedName].lastUpdatedState.remove(file); if (d->m_states[fixedName].lastUpdatedState.contains(file)) {
d->m_states[fixedName].lastUpdatedState.remove(file);
if (d->m_states.value(fixedName).lastUpdatedState.isEmpty()) { if (d->m_states.value(fixedName).lastUpdatedState.isEmpty()) {
d->m_states.remove(fixedName); d->m_states.remove(fixedName);
if (!fixedName.isEmpty()) { if (!fixedName.isEmpty()) {
d->m_fileWatcher->removePath(fixedName); d->m_fileWatcher->removePath(fixedName);
}
} }
} else {
// We could not find the fileinfo, try harder to remove it
removeFileInfo(file);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment