1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

check for double release

This commit is contained in:
Darien Raymond 2016-12-27 21:15:32 +01:00
parent 538b0720d5
commit 5769df496b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

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