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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user