IO buffer lifetime fix, source buffer must stay alive until the file write completes.

This commit is contained in:
Steve Atherton 2022-10-23 16:38:08 -07:00
parent 344290fdf1
commit a627df88c6
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ public:
m_buffer = Standalone<VectorRef<uint8_t>>(old.slice(size, old.size()));
// Write the old buffer to the underlying file and update the write offset
Future<Void> r = holdWhile(old, m_file->write(old.begin(), size, m_writeOffset));
Future<Void> r = uncancellable(holdWhile(old, m_file->write(old.begin(), size, m_writeOffset)));
m_writeOffset += size;
return r;