mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
+6
-1
@@ -194,9 +194,10 @@ func (t *tcpPacketConn) removeConn(conn net.Conn) {
|
||||
func (t *tcpPacketConn) Close() error {
|
||||
t.mu.Lock()
|
||||
|
||||
var shouldCloseRecvChan bool
|
||||
t.closeOnce.Do(func() {
|
||||
close(t.closedChan)
|
||||
close(t.recvChan)
|
||||
shouldCloseRecvChan = true
|
||||
})
|
||||
|
||||
for _, conn := range t.conns {
|
||||
@@ -208,6 +209,10 @@ func (t *tcpPacketConn) Close() error {
|
||||
|
||||
t.wg.Wait()
|
||||
|
||||
if shouldCloseRecvChan {
|
||||
close(t.recvChan)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user