1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-10 16:35:32 +01:00

Remove naked new[] in: builtin effects

This commit is contained in:
Paul Licameli
2016-04-14 12:35:15 -04:00
parent f858d97352
commit 6ca89c28ff
28 changed files with 558 additions and 774 deletions

View File

@@ -28,6 +28,7 @@
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "../SampleFormat.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
@@ -95,22 +96,19 @@ bool EffectEcho::ProcessInitialize(sampleCount WXUNUSED(totalLen), ChannelNames
if (requestedHistLen !=
(histLen = static_cast<size_t>(requestedHistLen.as_long_long())))
throw std::bad_alloc{};
history = new float[histLen];
history.reinit(histLen, true);
}
catch ( const std::bad_alloc& ) {
wxMessageBox(_("Requested value exceeds memory capacity."));
return false;
}
memset(history, 0, sizeof(float) * histLen);
return history != NULL;
}
bool EffectEcho::ProcessFinalize()
{
delete [] history;
history.reset();
return true;
}