diff --git a/include/fmt/os.h b/include/fmt/os.h index 0b0b94ed..78971e37 100644 --- a/include/fmt/os.h +++ b/include/fmt/os.h @@ -396,8 +396,10 @@ class ostream final : private detail::buffer { ostream(ostream&& other) : detail::buffer(other.data(), other.size(), other.capacity()), file_(std::move(other.file_)) { + other.clear(); other.set(nullptr, 0); } + ~ostream() { flush(); delete[] data();