Explorar el Código

Fix another dead lock in buffered writer

v2ray hace 9 años
padre
commit
3d6200dc64
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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