Преглед изворни кода

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