diff --git a/src/fcwt/fcwt.cpp b/src/fcwt/fcwt.cpp index 5194cf5..f96766d 100644 --- a/src/fcwt/fcwt.cpp +++ b/src/fcwt/fcwt.cpp @@ -37,6 +37,7 @@ limitations under the License. */ #include "fcwt.h" +#include Morlet::Morlet(float bandwidth) { four_wavelen = 0.9876f; @@ -100,8 +101,8 @@ void Morlet::getWavelet(float scale, complex* pwav, int pn) { pwav[t].imag(imag[t]); } - delete real; - delete imag; + free(real); + free(imag); }; //==============================================================// @@ -403,9 +404,15 @@ void FCWT::convolve(fftwf_plan p, fftwf_complex *Ihat, fftwf_complex *O1, comple #endif memset(lastscalemem,0,sizeof(fftwf_complex)*newsize); - fftbased(p, Ihat, O1, (float*)lastscalemem, wav->mother, newsize, scale, wav->imag_frequency, wav->doublesided); + fftbased(p, Ihat, O1, (float*)lastscalemem, wav->mother, newsize, scale, + wav->imag_frequency, wav->doublesided); if(use_normalization) fft_normalize((complex*)lastscalemem, newsize); memcpy(out, (complex*)lastscalemem, sizeof(complex)*size); + #ifdef _WIN32 + _aligned_free(lastscalemem); + #else + free(lastscalemem); + #endif } else { if(!out) { std::cout << "OUT NOT A POINTER" << std::endl; diff --git a/tests/test_fcwt.py b/tests/test_fcwt.py index 5302766..60b0956 100644 --- a/tests/test_fcwt.py +++ b/tests/test_fcwt.py @@ -239,13 +239,13 @@ def test_plan(): morl = Morlet(2.0) fcwt = FCWT(morl, 1, True, False) - fcwt.create_FFT_optimization_plan(2048,0) + fcwt.create_FFT_optimization_plan(2048, "FFTW_ESTIMATE") fname = "n2048_t1.wis" assert os.path.isfile(fname) fcwt = FCWT(morl, 8, True, False) - fcwt.create_FFT_optimization_plan(2048,0) + fcwt.create_FFT_optimization_plan(2048, "FFTW_ESTIMATE") fname = "n2048_t8.wis" - assert os.path.isfile(fname) \ No newline at end of file + assert os.path.isfile(fname)