Bug 1607205 - Reset RtcpEventObserver when deleting receive stream; r=ng

Holding a RefPtr to this in OnRtcpBye should keep the VideoConduit alive until
the callback completes. If this is not happening, it is likely that we're
racing with the destructor on the other thread. Clearing the callback early
will prevent this. This should not affect the VideoConduit because in that case
the callback is directly part of the receive stream, not attached to a channel.

Differential Revision: https://phabricator.services.mozilla.com/D60658

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dan Minor 2020-01-22 16:06:28 +00:00
parent aad6b11a7d
commit 30ead31cc6

View File

@ -1014,6 +1014,8 @@ void WebrtcAudioConduit::DeleteRecvStream() {
mCall->Call()->DestroyAudioReceiveStream(mRecvStream); mCall->Call()->DestroyAudioReceiveStream(mRecvStream);
mRecvStream = nullptr; mRecvStream = nullptr;
} }
mRecvChannelProxy->SetRtcpEventObserver(nullptr);
// Destroying the stream unregisters the transport // Destroying the stream unregisters the transport
mRecvChannelProxy->RegisterTransport(nullptr); mRecvChannelProxy->RegisterTransport(nullptr);
} }