Fix moving ostream while holding data
This commit is contained in:
parent
291b0075bb
commit
b77d2a8c85
@ -396,8 +396,10 @@ class ostream final : private detail::buffer<char> {
|
||||
ostream(ostream&& other)
|
||||
: detail::buffer<char>(other.data(), other.size(), other.capacity()),
|
||||
file_(std::move(other.file_)) {
|
||||
other.clear();
|
||||
other.set(nullptr, 0);
|
||||
}
|
||||
|
||||
~ostream() {
|
||||
flush();
|
||||
delete[] data();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user