Clear the stored transceivers before closing the PeerConnection#156
Merged
jmillan merged 2 commits intoversatica:v3from May 15, 2023
Merged
Clear the stored transceivers before closing the PeerConnection#156jmillan merged 2 commits intoversatica:v3from
jmillan merged 2 commits intoversatica:v3from
Conversation
jmillan
reviewed
May 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During a
{Send|Recv}Transportinstance destruction, itsHandleralso gets destroyed.The Handler stores a
PeerConnectionand a map of pointers to RTP transceivers.When the transport gets closed, the PC gets closed but the transceivers are leaked.
On the
m112branch 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 thepcinstance 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
m112branch, it does not address the current leaky behaviour.