mirror of https://github.com/v2ray/v2ray-core
check for double release
parent
538b0720d5
commit
5769df496b
|
@ -85,11 +85,15 @@ func (v *BufferedWriter) SetCached(cached bool) {
|
|||
}
|
||||
}
|
||||
|
||||
// Release implements common.Releasable.Release().
|
||||
func (v *BufferedWriter) Release() {
|
||||
v.Flush()
|
||||
|
||||
v.buffer.Release()
|
||||
v.buffer = nil
|
||||
if !v.buffer.IsEmpty() {
|
||||
v.Flush()
|
||||
}
|
||||
|
||||
if v.buffer != nil {
|
||||
v.buffer.Release()
|
||||
v.buffer = nil
|
||||
}
|
||||
common.Release(v.writer)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue