diff --git a/Src/Base/AMReX_VisMF.cpp b/Src/Base/AMReX_VisMF.cpp index 52efe827460..912be0b9b99 100644 --- a/Src/Base/AMReX_VisMF.cpp +++ b/Src/Base/AMReX_VisMF.cpp @@ -2202,7 +2202,7 @@ void VisMF::CloseStream(const std::string &fileName, bool forceClose) pifs.pstr = nullptr; pifs.isOpen = false; } - pifs.ioBuffer.clear(); + VisMFBuffer::ClearBuffer(pifs.ioBuffer); } diff --git a/Src/Base/AMReX_VisMFBuffer.H b/Src/Base/AMReX_VisMFBuffer.H index 843e5713f34..f095dbbebf2 100644 --- a/Src/Base/AMReX_VisMFBuffer.H +++ b/Src/Base/AMReX_VisMFBuffer.H @@ -29,6 +29,10 @@ public: ioBufferSize = iobuffersize; } + static void ClearBuffer (IO_Buffer& buf) { + IO_Buffer().swap(buf); + } + protected: static AMREX_EXPORT Long ioBufferSize; //!< ---- the settable buffer size