瀏覽代碼

Fix another dead lock in buffered writer

v2ray 9 年之前
父節點
當前提交
3d6200dc64
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      common/io/buffered_writer.go

+ 2 - 1
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