Do we need to open projects we are discarding?

James Crook <[email protected]> Thu, 8 Apr 2021 18:47:26 +0100
Newsgroups gmane.comp.audio.audacity.devel
Message-ID <CAMe=4isu8oNFBAz3ms9hdQX_NH8b1DxcY1SWeq2jv+GcfaBEtQ@mail.gmail.com>
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);

_______________________________________________
audacity-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-devel