1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Gracefully handle disk exhaustion exceptions during recording

This commit is contained in:
Paul Licameli
2016-11-22 14:10:53 -05:00
parent f4e2fb5eac
commit eeb301e50d
2 changed files with 112 additions and 61 deletions

View File

@@ -19,6 +19,7 @@
#include "MemoryX.h"
#include <vector>
#include <wx/atomic.h>
#ifdef USE_MIDI
@@ -692,6 +693,14 @@ private:
bool mSilentScrub;
sampleCount mScrubDuration;
#endif
// A flag tested and set in one thread, cleared in another. Perhaps
// this guarantee of atomicity is more cautious than necessary.
wxAtomicInt mRecordingException {};
void SetRecordingException()
{ wxAtomicInc( mRecordingException ); }
void ClearRecordingException()
{ if (mRecordingException) wxAtomicDec( mRecordingException ); }
};
#endif