diff --git a/libutils/SharedBuffer.cpp b/libutils/SharedBuffer.cpp index a8a9fb415..6c8c7d3dc 100644 --- a/libutils/SharedBuffer.cpp +++ b/libutils/SharedBuffer.cpp @@ -112,8 +112,9 @@ void SharedBuffer::acquire() const { int32_t SharedBuffer::release(uint32_t flags) const { int32_t prev = 1; - if (onlyOwner() || ((prev = mRefs.fetch_sub(1, std::memory_order_release) == 1) - && (atomic_thread_fence(std::memory_order_acquire), true))) { + if (onlyOwner() + || (((prev = mRefs.fetch_sub(1, std::memory_order_release)) == 1) + && (atomic_thread_fence(std::memory_order_acquire), true))) { mRefs.store(0, std::memory_order_relaxed); if ((flags & eKeepStorage) == 0) { free(const_cast(this));