Commit 2dac8e64 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add corruption check before creating backup file

parent 75e57704
......@@ -264,6 +264,7 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
break;
}
}
::mlt_pool_purge();
pCore->audioThumbCache.clear();
pCore->jobManager()->slotCancelJobs();
disconnect(pCore->window()->getMainTimeline()->controller(), &TimelineController::durationChanged, this, &ProjectManager::adjustProjectDuration);
......@@ -680,6 +681,11 @@ void ProjectManager::slotAutoSave()
scene.replace(i.key(), i.value());
}
}
if (!scene.contains(QLatin1String("<track "))) {
// In some unexplained cases, the MLT playlist is corrupted and all tracks are deleted. Don't save in that case.
pCore->displayMessage(i18n("Project was corrupted, cannot backup. Please close and reopen your project file to recover last backup"), ErrorMessage);
return;
}
m_project->slotAutoSave(scene);
m_lastSave.start();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment