mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
check for double release
This commit is contained in:
parent
538b0720d5
commit
5769df496b
@ -85,11 +85,15 @@ func (v *BufferedWriter) SetCached(cached bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// Release implements common.Releasable.Release().
|
||||
func (v *BufferedWriter) Release() {
|
||||
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
Block a user