Fix another dead lock in buffered writer

pull/168/head v1.13.1
v2ray 2016-05-22 19:41:48 +02:00
parent e00c424341
commit 3d6200dc64
1 changed files with 2 additions and 1 deletions

View File

@ -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