mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +02:00
Fix disk space checking to prevent error message
The error message only happens in debug builds, but the cause of the message still happens in release builds. Basically, the temporary project directory may not yet be created if the person is only monitoring.
This commit is contained in:
parent
5e46430d80
commit
f60afbb8da
@ -537,14 +537,21 @@ wxString DirManager::GetProjectName()
|
||||
wxLongLong DirManager::GetFreeDiskSpace()
|
||||
{
|
||||
wxLongLong freeSpace = -1;
|
||||
wxString path = projPath;
|
||||
wxFileName path;
|
||||
|
||||
if (projPath == wxT(""))
|
||||
path = mytemp;
|
||||
path.SetPath(projPath.IsEmpty() ? mytemp : projPath);
|
||||
|
||||
// Use the parent directory if the project directory hasn't yet been created
|
||||
if (!path.DirExists())
|
||||
{
|
||||
path.RemoveLastDir();
|
||||
}
|
||||
|
||||
if (!wxGetDiskSpace(path.GetFullPath(), NULL, &freeSpace))
|
||||
{
|
||||
if (!wxGetDiskSpace(path, NULL, &freeSpace))
|
||||
freeSpace = -1;
|
||||
}
|
||||
|
||||
return freeSpace;
|
||||
}
|
||||
|
||||
|
@ -4212,7 +4212,7 @@ void AudacityProject::OnTimer(wxTimerEvent& WXUNUSED(event))
|
||||
|
||||
// gAudioIO->GetNumCaptureChannels() should only be positive
|
||||
// when we are recording.
|
||||
if (gAudioIO->GetNumCaptureChannels() > 0) {
|
||||
if (GetAudioIOToken() > 0 && gAudioIO->GetNumCaptureChannels() > 0) {
|
||||
wxLongLong freeSpace = mDirManager->GetFreeDiskSpace();
|
||||
if (freeSpace >= 0) {
|
||||
wxString msg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user