Skip to content

Commit

Permalink
fix: upnp clear loop trap (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie authored May 26, 2024
1 parent 164b73c commit f705f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions portfwd.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ func (cl *Client) clearPortMappings() {
var wg sync.WaitGroup
wg.Add(mLen)
for _, m := range cl.upnpMappings {
go func() {
go func(m *upnpMapping) {
defer wg.Done()
cl.deletePortMapping(m.d, m.proto, m.externalPort)
}()
}(m)
}
cl.upnpMappings = nil
}

0 comments on commit f705f59

Please sign in to comment.