Skip to content

Clear the stored transceivers before closing the PeerConnection#156

Merged
jmillan merged 2 commits intoversatica:v3from
adriancretu:fix/handler_close
May 15, 2023
Merged

Clear the stored transceivers before closing the PeerConnection#156
jmillan merged 2 commits intoversatica:v3from
adriancretu:fix/handler_close

Conversation

@adriancretu
Copy link
Copy Markdown
Contributor

During a {Send|Recv}Transport instance destruction, its Handler also gets destroyed.
The Handler stores a PeerConnection and a map of pointers to RTP transceivers.

When the transport gets closed, the PC gets closed but the transceivers are leaked.

On the m112 branch the RTP transceiver map entries are now RTC smart pointers. This results in a fatal process hang during the destruction of the map and its entries, which occurs after the destruction of the pc instance variable.
RTPTransceiver destruction relies on waiting indefinitely for an event signaled by a thread which was owned by the now destroyed PC.

This fix simply clears the stored transceivers map before the PC is closed. This is sufficient (and necessary) for the m112 branch, it does not address the current leaky behaviour.

Comment thread src/Handler.cpp Outdated
@jmillan jmillan merged commit 7587335 into versatica:v3 May 15, 2023
@adriancretu adriancretu deleted the fix/handler_close branch May 15, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants