mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-12 07:19:01 -05:00
remove references after content is written
This commit is contained in:
parent
aefbc4c5de
commit
834dc4ab7c
@ -33,7 +33,14 @@ func (w *BufferToBytesWriter) WriteMultiBuffer(mb MultiBuffer) error {
|
||||
for _, b := range mb {
|
||||
bs = append(bs, b.Bytes())
|
||||
}
|
||||
w.cache = bs[:0]
|
||||
w.cache = bs
|
||||
|
||||
defer func() {
|
||||
for idx := range w.cache {
|
||||
w.cache[idx] = nil
|
||||
}
|
||||
w.cache = w.cache[:0]
|
||||
}()
|
||||
|
||||
nb := net.Buffers(bs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user