peer: properly clean up chanMsgStreams map on readHandler exit
This commit ensures that all references within the chanMsgStreams are all removed and deleted when the readHandler exits. This ensures that all objects don’t have extra references, and will properly be garbage collected.
This commit is contained in:
parent
36f4e2046d
commit
c183e8984c
4
peer.go
4
peer.go
@ -645,8 +645,10 @@ out:
|
||||
|
||||
p.Disconnect(errors.New("read handler closed"))
|
||||
|
||||
for _, chanStream := range chanMsgStreams {
|
||||
for cid, chanStream := range chanMsgStreams {
|
||||
chanStream.Stop()
|
||||
|
||||
delete(chanMsgStreams, cid)
|
||||
}
|
||||
|
||||
p.wg.Done()
|
||||
|
Loading…
Reference in New Issue
Block a user