1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-21 02:09:55 -04:00

agressively cleanup references at release

This commit is contained in:
v2ray
2016-03-10 16:56:19 +01:00
parent a341cab302
commit 1b5b599741
2 changed files with 4 additions and 0 deletions

View File

@@ -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 {

View File

@@ -60,4 +60,6 @@ func (this *BufferedWriter) SetCached(cached bool) {
func (this *BufferedWriter) Release() {
this.buffer.Release()
this.buffer = nil
this.writer = nil
}