lib/nfs/FileReader: clear the read_buffer in CancelRead()
Fixes assertion failure with libnfs 6.
This commit is contained in:
parent
1d35031024
commit
58e3b830e9
|
@ -138,7 +138,14 @@ void
|
||||||
NfsFileReader::CancelRead() noexcept
|
NfsFileReader::CancelRead() noexcept
|
||||||
{
|
{
|
||||||
if (state == State::READ) {
|
if (state == State::READ) {
|
||||||
connection->Cancel(*this, nullptr, {});
|
DisposablePointer dispose_value{};
|
||||||
|
|
||||||
|
#ifdef LIBNFS_API_2
|
||||||
|
assert(read_buffer);
|
||||||
|
dispose_value = ToDeleteArray(read_buffer.release());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
connection->Cancel(*this, nullptr, std::move(dispose_value));
|
||||||
state = State::IDLE;
|
state = State::IDLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue