mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02: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:
parent
11e924a49b
commit
0c4514efb0
@ -910,6 +910,10 @@ void ProjectAudioManager::OnAudioIOStopRecording()
|
|||||||
|
|
||||||
history.ModifyState( true ); // this might fail and throw
|
history.ModifyState( true ); // this might fail and throw
|
||||||
|
|
||||||
|
// CallAfter so that we avoid any problems of yielding
|
||||||
|
// to the event loop while still inside the timer callback,
|
||||||
|
// entering StopStream() recursively
|
||||||
|
wxTheApp->CallAfter( [&] {
|
||||||
ShowWarningDialog(&window, wxT("DropoutDetected"), XO("\
|
ShowWarningDialog(&window, wxT("DropoutDetected"), XO("\
|
||||||
Recorded audio was lost at the labeled locations. Possible causes:\n\
|
Recorded audio was lost at the labeled locations. Possible causes:\n\
|
||||||
\n\
|
\n\
|
||||||
@ -920,6 +924,7 @@ You are saving directly to a slow external storage device\n\
|
|||||||
),
|
),
|
||||||
false,
|
false,
|
||||||
XXO("Turn off dropout detection"));
|
XXO("Turn off dropout detection"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,6 +268,15 @@ SqliteSampleBlock::SqliteSampleBlock(
|
|||||||
|
|
||||||
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
|
// See ProjectFileIO::Bypass() for a description of mIO.mBypass
|
||||||
if (!mLocked && !Conn()->ShouldBypass())
|
if (!mLocked && !Conn()->ShouldBypass())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user