Drop peer request alloc reservations when peer is closed
Might fix a goroutine leak.
This commit is contained in:
parent
c202126a62
commit
12db16c478
3
peer.go
3
peer.go
|
@ -324,6 +324,9 @@ func (p *Peer) close() {
|
||||||
if p.updateRequestsTimer != nil {
|
if p.updateRequestsTimer != nil {
|
||||||
p.updateRequestsTimer.Stop()
|
p.updateRequestsTimer.Stop()
|
||||||
}
|
}
|
||||||
|
for _, prs := range p.peerRequests {
|
||||||
|
prs.allocReservation.Drop()
|
||||||
|
}
|
||||||
p.peerImpl.onClose()
|
p.peerImpl.onClose()
|
||||||
if p.t != nil {
|
if p.t != nil {
|
||||||
p.t.decPeerPieceAvailability(p)
|
p.t.decPeerPieceAvailability(p)
|
||||||
|
|
Loading…
Reference in New Issue