[Audacity-devel] Do we need to open projects we are discarding?
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: James C. <jam...@gm...> - 2021-04-08 17:48:05
|
I'm looking at this code which is called when doing DiscardAllProjects(). It actually opens the project we are discarding, including creating a checkpointing thread. But do we actually need to do that? Shouldn't we just delete the file? I'm thinking particularly of when the file may actually be bogus or corrupt. --James. void ProjectFileManager::DiscardAutosave(const FilePath &filename) { InvisibleTemporaryProject tempProject; auto &project = tempProject.Project(); auto &projectFileManager = Get(project); // Read the project, discarding autosave projectFileManager.ReadProjectFile(filename, true); |