Skip to content

Commit b2a19b3

Browse files
author
JJPPeters
committed
Fixed my previous fix for release builds
1 parent d48b10e commit b2a19b3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Strain/gpa.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ GPA::GPA(Eigen::MatrixXcd img)
1010

1111
// I think I had an error when using NULL before as technically they are the same and FFTW tries to optimise
1212
// for in-place FFTs..., These are just temporary to avoid that
13-
fftw_complex* temp_1;
14-
fftw_complex* temp_2;
13+
// can't just make pointer as it gets compiled out in release builds?
14+
fftw_complex temp_1 [1] = {};
15+
fftw_complex temp_2 [1] = {};
1516

1617
_FFTplan = std::make_shared<fftw_plan>(fftw_plan_dft_2d(static_cast<int>(_Image->rows()),
1718
static_cast<int>(_Image->cols()), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE));

src/Strain/phase.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Phase::Phase(std::shared_ptr<Eigen::MatrixXcd> inputFFT, double gx, double gy, d
1515
_FFTplan = std::move(forwardPlan);
1616
_IFFTplan = std::move(inversePlan);
1717

18-
fftw_complex* temp_1;
19-
fftw_complex* temp_2;
18+
fftw_complex temp_1 [1] = {};
19+
fftw_complex temp_2 [1] = {};
2020

2121
_FFTdiffplan = std::make_shared<fftw_plan>(fftw_plan_dft_2d(static_cast<int>(_FFT->rows() + 2),
2222
static_cast<int>(_FFT->cols() + 2), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE));

0 commit comments

Comments
 (0)