1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-19 23:21:33 +01:00
This commit is contained in:
Paul Licameli
2016-02-18 12:57:40 -05:00
parent e3e10f1fc1
commit a8652c5e74
8 changed files with 130 additions and 142 deletions

View File

@@ -597,25 +597,27 @@ AliasBlockFile::~AliasBlockFile()
bool AliasBlockFile::ReadSummary(void *data)
{
wxFFile summaryFile(mFileName.GetFullPath(), wxT("rb"));
wxLogNull *silence=0;
if(mSilentLog)silence= new wxLogNull();
if( !summaryFile.IsOpened() ){
{
Maybe<wxLogNull> silence{};
if (mSilentLog)
silence.create();
// NEW model; we need to return valid data
memset(data,0,(size_t)mSummaryInfo.totalSummaryBytes);
if(silence) delete silence;
if (!summaryFile.IsOpened()){
// we silence the logging for this operation in this object
// after first occurrence of error; it's already reported and
// spewing at the user will complicate the user's ability to
// deal
mSilentLog=TRUE;
return true;
// NEW model; we need to return valid data
memset(data, 0, (size_t)mSummaryInfo.totalSummaryBytes);
}else mSilentLog=FALSE; // worked properly, any future error is NEW
// we silence the logging for this operation in this object
// after first occurrence of error; it's already reported and
// spewing at the user will complicate the user's ability to
// deal
mSilentLog = TRUE;
return true;
if(silence) delete silence;
}
else mSilentLog = FALSE; // worked properly, any future error is NEW
}
int read = summaryFile.Read(data, (size_t)mSummaryInfo.totalSummaryBytes);