1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

AUP3: Reduce crash exposure when compacting

There's still the possibility if a crash happens at just the
right time that the project will be named "<project>_compact_back"
so we should probably look for it during startup.

This also changes all "Vacuum" references to "compact".
This commit is contained in:
Leland Lucius
2020-07-28 23:25:50 -05:00
parent dad27f9eea
commit d4627f0daf
7 changed files with 101 additions and 139 deletions

View File

@@ -676,7 +676,7 @@ bool ProjectFileManager::SaveFromTimerRecording(wxFileName fnFile)
return success;
}
void ProjectFileManager::VacuumProject()
void ProjectFileManager::CompactProject()
{
auto &project = mProject;
auto &projectFileIO = ProjectFileIO::Get(project);
@@ -691,8 +691,8 @@ void ProjectFileManager::VacuumProject()
wt->CloseLock();
}
// Attempt to vacuum the project
projectFileIO.Vacuum(mLastSavedTracks);
// Attempt to compact the project
projectFileIO.Compact(mLastSavedTracks);
}
}
@@ -711,7 +711,7 @@ void ProjectFileManager::CloseProject()
projectFileIO.CloseProject();
// Blocks were locked in VacuumProject, so DELETE the data structure so that
// Blocks were locked in CompactProject, so DELETE the data structure so that
// there's no memory leak.
if (mLastSavedTracks)
{