1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Bug2605: Save-as should not cause original to repoen with warnings...

... Problem was that before abandoning the connection to the original path,
compaction was done only sometimes, according to the criterion of estimated
%20 space savings at least.  But this could cause the project to reopen with
orphan blocks in it, which were detected and reported as an improper save.

The easy solution is to force compaction always in this case.

Direct save does not have this problem because what would otherwise be orphaned
blocks are directly deleted from the database when undo states are destroyed
and sample blocks become unreferenced.  So compacting only sometimes does not
cause orphan blocks on reopening.
This commit is contained in:
Paul Licameli 2020-12-02 00:41:07 -05:00
parent 105558c7bf
commit 742134caaa

View File

@ -2123,7 +2123,11 @@ bool ProjectFileIO::SaveProject(
// Try to compact the original project file
auto empty = TrackList::Create(&mProject);
Compact( { lastSaved ? lastSaved : empty.get() } );
Compact( { lastSaved ? lastSaved : empty.get() },
// Bug 2605: force compaction of the original when saving-as,
// so that the original does not reopen with orphan blocks,
// causing warning dialogs about improper save
true );
// Save to close the original project file now
CloseProject();