1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Bug2058: shouldn't lose data in original project when saving-as...

... Bug was introduced at commit e87e15f, which was part of an unsuccessful
attempt to fix performance Bug1979
This commit is contained in:
Paul Licameli 2019-01-26 14:18:01 -05:00
parent b3dafcedd1
commit 0941eaa0d5

View File

@ -3977,6 +3977,8 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
if (!success) if (!success)
return false; return false;
{
std::vector<std::unique_ptr<WaveTrack::Locker>> lockers;
Maybe<DirManager::ProjectSetter> pSetter; Maybe<DirManager::ProjectSetter> pSetter;
if (fromSaveAs && !bWantSaveCopy) { if (fromSaveAs && !bWantSaveCopy) {
@ -3987,7 +3989,6 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
// (Otherwise the NEW project would be fine, but the old one would // (Otherwise the NEW project would be fine, but the old one would
// be empty of all of its files.) // be empty of all of its files.)
std::vector<std::unique_ptr<WaveTrack::Locker>> lockers;
if (mLastSavedTracks) { if (mLastSavedTracks) {
lockers.reserve(mLastSavedTracks->size()); lockers.reserve(mLastSavedTracks->size());
for (auto wt : mLastSavedTracks->Any<WaveTrack>()) for (auto wt : mLastSavedTracks->Any<WaveTrack>())
@ -4022,6 +4023,7 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
if (pSetter) if (pSetter)
pSetter->Commit(); pSetter->Commit();
}
if ( !bWantSaveCopy ) if ( !bWantSaveCopy )
{ {