mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 09:00:52 +02:00
Fix crash on exit, which could be seen at least on Mac, if you...
... Start Audacity; generate some noise; shift clip with Time-Shift tool; command+Q to exit; say No to save changes. The scope of a GuardedCall needs to be expanded, because Conn() can throw, so that no exceptions escape the destructor of SqliteSampleBlock. But now there is an error dialog on exit instead of a crash.
This commit is contained in:
parent
c5c7a6d08a
commit
cbd21c5fff
@ -315,6 +315,7 @@ SqliteSampleBlock::~SqliteSampleBlock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// See ProjectFileIO::Bypass() for a description of mIO.mBypass
|
// See ProjectFileIO::Bypass() for a description of mIO.mBypass
|
||||||
|
GuardedCall( [this]{
|
||||||
if (!mLocked && !Conn()->ShouldBypass())
|
if (!mLocked && !Conn()->ShouldBypass())
|
||||||
{
|
{
|
||||||
// In case Delete throws, don't let an exception escape a destructor,
|
// In case Delete throws, don't let an exception escape a destructor,
|
||||||
@ -322,8 +323,9 @@ SqliteSampleBlock::~SqliteSampleBlock()
|
|||||||
// is presented to the user.
|
// is presented to the user.
|
||||||
// The failure in this case may be a less harmful waste of space in the
|
// The failure in this case may be a less harmful waste of space in the
|
||||||
// database, which should not cause aborting of the attempted edit.
|
// database, which should not cause aborting of the attempted edit.
|
||||||
GuardedCall( [this]{ Delete(); } );
|
Delete();
|
||||||
}
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
DBConnection *SqliteSampleBlock::Conn() const
|
DBConnection *SqliteSampleBlock::Conn() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user