Delete down track on close (#374)

Note that it is called from Unbind also (previous behaviour). It should
be fine as long as there is no new down track for the same peer added
between close calling it and unbind calling it.
This commit is contained in:
Raja Subramanian authored and GitHub committed 2022-01-26 13:22:39 +05:30
1 parent c92e0e38d5
commit 44afa8bae1
1 file changed
+3
+3
View File
@@ -453,9 +453,12 @@ func (d *DownTrack) CloseWithFlush(flush bool) {
d.closeOnce.Do(func() {
Logger.V(1).Info("Closing sender", "peer_id", d.peerID, "kind", d.kind)
d.receiver.DeleteDownTrack(d.peerID)
if d.onCloseHandler != nil {
d.onCloseHandler()
}
close(d.done)
})
}