summaryrefslogtreecommitdiff
path: root/src/sndobj/IFGram.cpp
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2013-06-14 11:47:06 +0200
committerJohn Glover <j@johnglover.net>2013-06-14 11:47:06 +0200
commit364d1a9352cf1adcf08fbd4f0e793f24540d7402 (patch)
treeb001aadeb38c96104c6fbd026519c7161486cc28 /src/sndobj/IFGram.cpp
parent2114ea951d728527ff5e833030d717c635b51821 (diff)
downloadsimpl-364d1a9352cf1adcf08fbd4f0e793f24540d7402.tar.gz
simpl-364d1a9352cf1adcf08fbd4f0e793f24540d7402.tar.bz2
simpl-364d1a9352cf1adcf08fbd4f0e793f24540d7402.zip
Add basic SndObjPeakDetection tests. Fix memory leaks.
Diffstat (limited to 'src/sndobj/IFGram.cpp')
-rw-r--r--src/sndobj/IFGram.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sndobj/IFGram.cpp b/src/sndobj/IFGram.cpp
index a5b374d..fb4cfa7 100644
--- a/src/sndobj/IFGram.cpp
+++ b/src/sndobj/IFGram.cpp
@@ -60,7 +60,14 @@ IFGram::IFGram(Table* window, SndObj* input, double scale,
}
IFGram::~IFGram(){
- delete[] m_diffwin;
+ if(m_diffwin){
+ delete[] m_diffwin;
+ m_diffwin = NULL;
+ }
+ if(m_pdiff){
+ delete[] m_pdiff;
+ m_pdiff = NULL;
+ }
fftw_destroy_plan(m_diffplan);
fftw_free(m_diffsig);