]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Reader.Close: Don’t set t to nil, we may still expect it
authorMatt Joiner <anacrolix@gmail.com>
Mon, 5 Dec 2016 11:00:26 +0000 (22:00 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 5 Dec 2016 11:00:26 +0000 (22:00 +1100)
For example in goroutines spawned in ReadContext.

reader.go

index 0336a2fd7388a73d584357310e6ba99d41d1231c..999bd70d5a5b781fe3b6bc8c9290f2a0b662661f 100644 (file)
--- a/reader.go
+++ b/reader.go
@@ -211,7 +211,6 @@ func (r *Reader) Close() error {
        r.t.cl.mu.Lock()
        defer r.t.cl.mu.Unlock()
        r.t.deleteReader(r)
-       r.t = nil
        return nil
 }