# HG changeset patch # User Chris Cannam # Date 1336754269 -3600 # Node ID d6bb46a1e70c80be91bb58dd9c71abfe7e0ad71c # Parent f2db6070607528aebf58b31a7acf7850541939c5 Fix big memory leak diff -r f2db60706075 -r d6bb46a1e70c songparts/SongParts.cpp --- a/songparts/SongParts.cpp Fri May 11 17:37:42 2012 +0100 +++ b/songparts/SongParts.cpp Fri May 11 17:37:49 2012 +0100 @@ -163,12 +163,12 @@ tuneLocal(0.0), doNormalizeChroma(0), rollon(0.0), - s(0.7), - sinvalues(0), - cosvalues(0), - window(HanningWindow, block_size), - fft(block_size), - inputSampleRate(inputSampleRate) + s(0.7), + sinvalues(0), + cosvalues(0), + window(HanningWindow, block_size), + fft(block_size), + inputSampleRate(inputSampleRate) { // make the *note* dictionary matrix dict = new float[nNote * 84]; @@ -368,6 +368,7 @@ SongPartitioner::SongPartitioner(float inputSampleRate) : Vamp::Plugin(inputSampleRate), m_d(0), + m_chromadata(0), m_bpb(4), m_pluginFrameCount(0) { @@ -378,6 +379,7 @@ SongPartitioner::~SongPartitioner() { delete m_d; + delete m_chromadata; } @@ -469,6 +471,10 @@ delete m_d; m_d = 0; } + if (m_chromadata) { + delete m_chromadata; + m_chromadata = 0; + } if (channels < getMinChannelCount() || channels > getMaxChannelCount()) {