comparison Source/FFTW.h @ 3:005e311b5e62

Fixed memory leak. :) Need to fix Debug FFTW now though.
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Fri, 10 Jul 2015 00:33:15 +0100
parents e86e9c111b29
children 345acbd06029
comparison
equal deleted inserted replaced
2:c649e493c30a 3:005e311b5e62
43 memset(tempImag,0, fftLength * sizeof(float)); 43 memset(tempImag,0, fftLength * sizeof(float));
44 fftwf_iodim dim; 44 fftwf_iodim dim;
45 dim.n = fftLength; 45 dim.n = fftLength;
46 dim.is = 1; 46 dim.is = 1;
47 dim.os = 1; 47 dim.os = 1;
48 m_plan = fftwf_plan_guru_split_dft_r2c( 1, &dim, 0, NULL, tempInput, tempReal, tempImag, FFTW_ESTIMATE ); 48 m_plan = fftwf_plan_guru_split_dft_r2c( 1, &dim, 0, nullptr, tempInput, tempReal, tempImag, FFTW_ESTIMATE );
49 delete[] tempInput; 49 delete[] tempInput;
50 tempInput = nullptr; 50 tempInput = nullptr;
51 delete[] tempReal; 51 delete[] tempReal;
52 tempReal = nullptr; 52 tempReal = nullptr;
53 delete[] tempImag; 53 delete[] tempImag;
55 } 55 }
56 56
57 57
58 ~FFTW() 58 ~FFTW()
59 { 59 {
60 if(m_plan != NULL) 60 if(m_plan != nullptr)
61 { 61 {
62 fftwf_destroy_plan( m_plan ); 62 fftwf_destroy_plan( m_plan );
63 } 63 }
64 } 64 }
65 65