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

Avoid some unexpected recursions because of yields to event loop...

... See code comments.

Not proved to be a cause of data loss bugs, but they caused surprises when
trying to step in the debugger.
This commit is contained in:
Paul Licameli
2020-08-26 16:01:54 -04:00
parent 11e924a49b
commit 0c4514efb0
2 changed files with 18 additions and 4 deletions

View File

@@ -268,6 +268,15 @@ SqliteSampleBlock::SqliteSampleBlock(
SqliteSampleBlock::~SqliteSampleBlock()
{
if (mBlockID == 0) {
// The block object was constructed but failed to Load() or Commit().
// Just let the stack unwind. Don't violate the assertion in
// Delete(), which may do odd recursive things in debug builds when it
// yields to the UI to put up a dialog, but then dispatches timer
// events that try again to finish recording.
return;
}
// See ProjectFileIO::Bypass() for a description of mIO.mBypass
if (!mLocked && !Conn()->ShouldBypass())
{