1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Remove naked new[] in: tracks

This commit is contained in:
Paul Licameli
2016-04-14 12:17:59 -04:00
parent 2b23667211
commit 18be1bdad6
8 changed files with 62 additions and 107 deletions

View File

@@ -653,17 +653,17 @@ private:
void Free();
struct Buffer {
float *data;
Floats data;
sampleCount start;
sampleCount len;
Buffer() : data(0), start(0), len(0) {}
void Free() { delete[] data; data = 0; start = 0; len = 0; }
Buffer() : start(0), len(0) {}
void Free() { data.reset(); start = 0; len = 0; }
sampleCount end() const { return start + len; }
void swap ( Buffer &other )
{
std::swap( data, other.data );
data .swap ( other.data );
std::swap( start, other.start );
std::swap( len, other.len );
}