diff --git a/common/io/buffered_writer.go b/common/io/buffered_writer.go index a64e12d01..75712c250 100644 --- a/common/io/buffered_writer.go +++ b/common/io/buffered_writer.go @@ -70,10 +70,11 @@ func (this *BufferedWriter) SetCached(cached bool) { } func (this *BufferedWriter) Release() { + this.Flush() + this.Lock() defer this.Unlock() - this.Flush() this.buffer.Release() this.buffer = nil this.writer = nil