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:
parent
105558c7bf
commit
742134caaa
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user