Fix goroutine leak in opusReceiver (#393)

This commit is contained in:
Ammar Bandukwala 2017-06-10 15:39:27 -05:00 committed by Chris Rhodes
parent 874325a504
commit 0983790428

View file

@ -814,7 +814,11 @@ func (v *VoiceConnection) opusReceiver(udpConn *net.UDPConn, close <-chan struct
p.Opus, _ = secretbox.Open(nil, recvbuf[12:rlen], &nonce, &v.op4.SecretKey) p.Opus, _ = secretbox.Open(nil, recvbuf[12:rlen], &nonce, &v.op4.SecretKey)
if c != nil { if c != nil {
c <- &p select {
case c <- &p:
case <-close:
return
}
} }
} }
} }