Skip to content

Commit

Permalink
close hash results
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 4, 2024
1 parent 76e9891 commit d04dc67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,10 @@ func (t *Torrent) close(wg *sync.WaitGroup) (err error) {
t.cl.event.Broadcast()
t.pieceStateChanges.Close()
t.updateWantPeersEvent(false)
if t.hashResults != nil {
close(t.hashResults)
t.hashResults = nil
}
return
}

Expand Down Expand Up @@ -3145,7 +3149,7 @@ func (t *Torrent) DisallowDataDownload() {
func() {
// Could check if peer request state is empty/not interested?
c.updateRequests("disallow data download", true)
c.cancelAllRequests(true,true)
c.cancelAllRequests(true, true)
}()
}
}
Expand Down

0 comments on commit d04dc67

Please sign in to comment.