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

AUP3: Don't delete sample blocks prematurely

The wrong sample blocks would be deleted at close in step 6:

1) New Project
2) Save and name
3) Import one stereo MP3 (about 6 minutes)
4) Save, close and re-open
5) Apply Bass and Treble to the track using real-time preview
6) Save, close and re-open
7) Message Failed to retrieve sample block
This commit is contained in:
Leland Lucius
2020-07-25 20:03:23 -05:00
parent 03762d0ca3
commit c1884349d5
4 changed files with 4 additions and 11 deletions

View File

@@ -2162,7 +2162,7 @@ AutoCommitTransaction::~AutoCommitTransaction()
{
if (mInTrans)
{
if (!mIO.TransactionRollback(mName))
if (!mIO.TransactionCommit(mName))
{
// Do not throw from a destructor!
// This has to be a no-fail cleanup that does the best that it can.
@@ -2170,13 +2170,13 @@ AutoCommitTransaction::~AutoCommitTransaction()
}
}
bool AutoCommitTransaction::Commit()
bool AutoCommitTransaction::Rollback()
{
if ( !mInTrans )
// Misuse of this class
THROW_INCONSISTENCY_EXCEPTION;
mInTrans = !mIO.TransactionCommit(mName);
mInTrans = !mIO.TransactionRollback(mName);
return mInTrans;
}