mirror of https://github.com/v2ray/v2ray-core
agressively cleanup references at release
parent
a341cab302
commit
1b5b599741
|
@ -22,6 +22,8 @@ func NewBufferedReader(rawReader io.Reader) *BufferedReader {
|
|||
|
||||
func (this *BufferedReader) Release() {
|
||||
this.buffer.Release()
|
||||
this.buffer = nil
|
||||
this.reader = nil
|
||||
}
|
||||
|
||||
func (this *BufferedReader) Cached() bool {
|
||||
|
|
|
@ -60,4 +60,6 @@ func (this *BufferedWriter) SetCached(cached bool) {
|
|||
|
||||
func (this *BufferedWriter) Release() {
|
||||
this.buffer.Release()
|
||||
this.buffer = nil
|
||||
this.writer = nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue