diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_path.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_path.hpp index 3505790cb..9d3de7b8e 100644 --- a/libraries/libstratosphere/include/stratosphere/fs/fs_path.hpp +++ b/libraries/libstratosphere/include/stratosphere/fs/fs_path.hpp @@ -62,6 +62,12 @@ namespace ams::fs { return *this; } + std::unique_ptr ReleaseBuffer() { + auto released = std::unique_ptr(m_buffer, ::ams::fs::impl::Deleter(this->GetLength())); + this->ResetBuffer(); + return released; + } + constexpr ALWAYS_INLINE void ResetBuffer() { m_buffer = nullptr; this->SetLength(0); @@ -118,15 +124,15 @@ namespace ams::fs { constexpr ~Path() { /* ... */ } - WriteBuffer ReleaseBuffer() { + std::unique_ptr ReleaseBuffer() { /* Check pre-conditions. */ AMS_ASSERT(m_write_buffer.Get() != nullptr); /* Reset. */ m_str = EmptyPath; - /* Return our write buffer. */ - return std::move(m_write_buffer); + /* Release our write buffer. */ + return m_write_buffer.ReleaseBuffer(); } constexpr Result SetShallowBuffer(const char *buffer) {