mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
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
1 changed files with 3 additions and 1 deletions
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…
Add table
Reference in a new issue