Fixed unexpected goroutine error

TURN client's loc conn was not closed when agent.Close() was called
Relates to pion/webrtc#740
This commit is contained in:
Yutaka Takeda
2019-07-17 11:12:26 -07:00
committed by Sean DuBois
parent f4913c135a
commit a1667f5cb7
+1 -2
View File
@@ -347,9 +347,8 @@ func (a *Agent) gatherCandidatesRelay(urls []*URL) error {
RelAddr: laddr.IP.String(),
RelPort: laddr.Port,
OnClose: func() error {
err2 := relayConn.Close()
client.Close()
return err2
return locConn.Close()
},
}
candidate, err := NewCandidateRelay(&relayConfig)