mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 08:40:27 +02:00
Bug2605: Don't leave orphans in original project after save-as
This commit is contained in:
parent
47bdf27f2d
commit
b6ce29d234
@ -2121,6 +2121,16 @@ bool ProjectFileIO::SaveProject(
|
|||||||
// Autosave no longer needed in original project file
|
// Autosave no longer needed in original project file
|
||||||
AutoSaveDelete();
|
AutoSaveDelete();
|
||||||
|
|
||||||
|
if (lastSaved) {
|
||||||
|
// Bug2605: Be sure not to save orphan blocks
|
||||||
|
bool recovered = mRecovered;
|
||||||
|
SampleBlockIDSet blockids;
|
||||||
|
InspectBlocks( *lastSaved, {}, &blockids );
|
||||||
|
DeleteBlocks(blockids, true);
|
||||||
|
// Don't set mRecovered if any were deleted
|
||||||
|
mRecovered = recovered;
|
||||||
|
}
|
||||||
|
|
||||||
// Try to compact the original project file
|
// Try to compact the original project file
|
||||||
auto empty = TrackList::Create(&mProject);
|
auto empty = TrackList::Create(&mProject);
|
||||||
Compact( { lastSaved ? lastSaved : empty.get() } );
|
Compact( { lastSaved ? lastSaved : empty.get() } );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user