mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +02:00
Bug 2546 - Recording onto a nearly full disk results in two error messages re "disk full"
This commit is contained in:
parent
2cc6dccc5d
commit
3978e8c9ee
@ -21,6 +21,10 @@ Paul Licameli -- split from ProjectFileIO.cpp
|
|||||||
#include "FileException.h"
|
#include "FileException.h"
|
||||||
#include "wxFileNameWrapper.h"
|
#include "wxFileNameWrapper.h"
|
||||||
|
|
||||||
|
#include "./commands/CommandContext.h"
|
||||||
|
#include "./ProjectAudioManager.h"
|
||||||
|
|
||||||
|
|
||||||
// Configuration to provide "safe" connections
|
// Configuration to provide "safe" connections
|
||||||
static const char *SafeConfig =
|
static const char *SafeConfig =
|
||||||
"PRAGMA <schema>.locking_mode = SHARED;"
|
"PRAGMA <schema>.locking_mode = SHARED;"
|
||||||
@ -276,6 +280,13 @@ sqlite3_stmt *DBConnection::GetStatement(enum StatementID id)
|
|||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OnStopAudio()
|
||||||
|
{
|
||||||
|
ProjectAudioManager::Get( *GetActiveProject() ).Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DBConnection::CheckpointThread()
|
void DBConnection::CheckpointThread()
|
||||||
{
|
{
|
||||||
// Open another connection to the DB to prevent blocking the main thread.
|
// Open another connection to the DB to prevent blocking the main thread.
|
||||||
@ -335,14 +346,28 @@ void DBConnection::CheckpointThread()
|
|||||||
"For tips on freeing up space, click the help button."
|
"For tips on freeing up space, click the help button."
|
||||||
).Format(message1);
|
).Format(message1);
|
||||||
|
|
||||||
|
// Stop trying to checkpoint
|
||||||
|
giveUp = true;
|
||||||
|
|
||||||
|
|
||||||
|
// Stop the audio.
|
||||||
|
// OnStopAudio happens in the main thread.
|
||||||
|
GuardedCall(
|
||||||
|
[&message] {
|
||||||
|
throw SimpleMessageBoxException{
|
||||||
|
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; },
|
||||||
|
[&](AudacityException * e) {; },
|
||||||
|
[&](AudacityException * e) { OnStopAudio(); }
|
||||||
|
);
|
||||||
|
|
||||||
|
// The message box in the previous GuardedCall is swallowed,
|
||||||
|
// so send it again....
|
||||||
// Throw and catch and AudacityException, enqueuing the
|
// Throw and catch and AudacityException, enqueuing the
|
||||||
// error message box for the event loop in the main thread
|
// error message box for the event loop in the main thread
|
||||||
GuardedCall([&message] {
|
GuardedCall([&message] {
|
||||||
throw SimpleMessageBoxException{
|
throw SimpleMessageBoxException{
|
||||||
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; } );
|
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; }
|
||||||
|
);
|
||||||
// Stop trying to checkpoint
|
|
||||||
giveUp = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user