From d04dc67075942026222a903beebeefbed92ff982 Mon Sep 17 00:00:00 2001 From: Mark Holt Date: Thu, 4 Jul 2024 17:42:36 +0100 Subject: [PATCH] close hash results --- torrent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index bcc99de57b..2bc693407c 100644 --- a/torrent.go +++ b/torrent.go @@ -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 } @@ -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) }() } }