diff --git a/Src/Base/AMReX_MFIter.H b/Src/Base/AMReX_MFIter.H index 2d0c631731b..9e968aa1d8b 100644 --- a/Src/Base/AMReX_MFIter.H +++ b/Src/Base/AMReX_MFIter.H @@ -180,7 +180,7 @@ protected: IndexType typ; bool dynamic; - bool initialized; + bool finalized = false; struct DeviceSync { DeviceSync () = default; diff --git a/Src/Base/AMReX_MFIter.cpp b/Src/Base/AMReX_MFIter.cpp index 4c18feef66f..4cd9832b747 100644 --- a/Src/Base/AMReX_MFIter.cpp +++ b/Src/Base/AMReX_MFIter.cpp @@ -215,13 +215,13 @@ MFIter::~MFIter () void MFIter::Finalize () { - if (!initialized) return; + if (finalized) return; + finalized = true; #ifdef AMREX_USE_OMP #pragma omp master #endif { - initialized = false; depth = 0; } @@ -357,13 +357,6 @@ MFIter::Initialize () typ = fabArray.boxArray().ixType(); } - -#ifdef AMREX_USE_OMP -#pragma omp master -#endif - { - initialized = true; - } } Box