mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Campbell Barton's patch for mem leaks, http://www.graphicall.org/ftp/ideasman42/audacity_mem_leak_fix_r12450.diff
This commit is contained in:
parent
d571ece7e6
commit
51e0391b7d
@ -237,8 +237,6 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
wxString prefix = ::wxPathOnly(files[i]);
|
||||
::wxSetWorkingDirectory(prefix);
|
||||
|
||||
Module *module = new Module(files[i]);
|
||||
|
||||
#ifdef EXPERIMENTAL_MODULE_PREFS
|
||||
if( !IsAllowedModule( files[i] ) ) // don't try and check the in-date-ness before this as that means loading the module to call it's GetVersionString, which could do anything.
|
||||
#endif EXPERIMENTAL_MODULE_PREFS
|
||||
@ -254,6 +252,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
continue;
|
||||
}
|
||||
|
||||
Module *module = new Module(files[i]);
|
||||
if (module->Load()) // it will get rejected if there are version problems
|
||||
{
|
||||
mInstance->mModules.Add(module);
|
||||
|
@ -184,7 +184,11 @@ bool Sequence::ConvertToSampleFormat(sampleFormat format, bool* pbChanged)
|
||||
|
||||
bSuccess = (pOldBlockFile->ReadData(bufferOld, oldFormat, 0, len) > 0);
|
||||
if (!bSuccess)
|
||||
{
|
||||
DeleteSamples(bufferNew);
|
||||
DeleteSamples(bufferOld);
|
||||
break;
|
||||
}
|
||||
|
||||
CopySamples(bufferOld, oldFormat, bufferNew, mSampleFormat, len);
|
||||
|
||||
|
@ -117,6 +117,10 @@ void EffectChangePitch::DeduceFrequencies()
|
||||
for(j=1; j<windowSize/2; j++)
|
||||
if (freqa[j] > freqa[argmax])
|
||||
argmax = j;
|
||||
|
||||
delete [] freq;
|
||||
delete [] freqa;
|
||||
|
||||
lag = (windowSize/2 - 1) - argmax;
|
||||
m_dStartFrequency = rate / lag;
|
||||
}
|
||||
|
@ -2675,6 +2675,9 @@ void EqualizationDialog::OnInvert(wxCommandEvent &event) // Inverts any curve
|
||||
mLogEnvelope->Move(when[i] , -value[i]);
|
||||
}
|
||||
|
||||
delete [] when;
|
||||
delete [] value;
|
||||
|
||||
// copy it back to the other one (just in case)
|
||||
if(lin)
|
||||
EnvLinToLog();
|
||||
|
@ -233,6 +233,7 @@ int ExportMP2::Export(AudacityProject *project,
|
||||
{
|
||||
wxMessageBox(_("Cannot export MP2 with this sample rate and bit rate"),
|
||||
_("Error"), wxICON_STOP);
|
||||
twolame_close(&encodeOptions);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -243,6 +244,7 @@ int ExportMP2::Export(AudacityProject *project,
|
||||
FileIO outFile(fName, FileIO::Output);
|
||||
if (!outFile.IsOpened()) {
|
||||
wxMessageBox(_("Unable to open target file for writing"));
|
||||
twolame_close(&encodeOptions);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -596,7 +596,10 @@ char *ExportPCM::ConvertTo7bitASCII(const wxString wxStr)
|
||||
return NULL;
|
||||
char *pSrc = (char *)malloc(sr);
|
||||
if (!pSrc)
|
||||
{
|
||||
free(pDest);
|
||||
return NULL;
|
||||
}
|
||||
memset(pDest, 0, sr);
|
||||
memset(pSrc, 0, sr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user