From b2a19b3a2e83b94fdfc3092d052c621c197d361a Mon Sep 17 00:00:00 2001 From: JJPPeters Date: Wed, 23 Jun 2021 19:51:51 +0100 Subject: [PATCH] Fixed my previous fix for release builds --- src/Strain/gpa.cpp | 5 +++-- src/Strain/phase.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Strain/gpa.cpp b/src/Strain/gpa.cpp index 089f50e..4a1b190 100644 --- a/src/Strain/gpa.cpp +++ b/src/Strain/gpa.cpp @@ -10,8 +10,9 @@ GPA::GPA(Eigen::MatrixXcd img) // I think I had an error when using NULL before as technically they are the same and FFTW tries to optimise // for in-place FFTs..., These are just temporary to avoid that - fftw_complex* temp_1; - fftw_complex* temp_2; + // can't just make pointer as it gets compiled out in release builds? + fftw_complex temp_1 [1] = {}; + fftw_complex temp_2 [1] = {}; _FFTplan = std::make_shared(fftw_plan_dft_2d(static_cast(_Image->rows()), static_cast(_Image->cols()), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE)); diff --git a/src/Strain/phase.cpp b/src/Strain/phase.cpp index f00dfb7..87ea02c 100644 --- a/src/Strain/phase.cpp +++ b/src/Strain/phase.cpp @@ -15,8 +15,8 @@ Phase::Phase(std::shared_ptr inputFFT, double gx, double gy, d _FFTplan = std::move(forwardPlan); _IFFTplan = std::move(inversePlan); - fftw_complex* temp_1; - fftw_complex* temp_2; + fftw_complex temp_1 [1] = {}; + fftw_complex temp_2 [1] = {}; _FFTdiffplan = std::make_shared(fftw_plan_dft_2d(static_cast(_FFT->rows() + 2), static_cast(_FFT->cols() + 2), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE));