diff --git a/source/include/MaxBufferAdaptor.hpp b/source/include/MaxBufferAdaptor.hpp index bbd632ef0..20dda8f6e 100644 --- a/source/include/MaxBufferAdaptor.hpp +++ b/source/include/MaxBufferAdaptor.hpp @@ -38,7 +38,10 @@ class MaxBufferAdaptor : public BufferAdaptor // ; lock(); release(); - if (mBufref) object_free(mBufref); + t_buffer_ref* tmp{nullptr}; + using std::swap; + swap(tmp,mBufref); + if (tmp) object_free(tmp); } MaxBufferAdaptor(const MaxBufferAdaptor&) = delete;