agressively cleanup references at release

pull/109/head
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
}