diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp index 78a6df16..90ba5a94 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.cpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp @@ -253,11 +253,14 @@ void FileSystemModel::updateWatcher() { void FileSystemModel::updateEntries() { if (m_path.isEmpty()) { if (!m_entries.isEmpty()) { + auto toDelete = m_entries; + beginResetModel(); - qDeleteAll(m_entries); m_entries.clear(); - emit entriesChanged(); endResetModel(); + emit entriesChanged(); + + qDeleteAll(toDelete); } return;