Fixed observer unsubscribtion in RTCRtpReceiver.

Missing unsubscribtion caused accessing invalid pointer inside
AudioRtpReceiver::OnFirstPacketReceived on short-lived
RTCRtpReceiver objects.

Bug: webrtc:6112
Change-Id: I5df141628e1cfd69aff59177d395c3246e1bf367
Reviewed-on: https://webrtc-review.googlesource.com/54306
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22157}
This commit is contained in:
Yura Yaroshevich
2018-02-22 13:44:27 +03:00
committed by Commit Bot
parent c66810830c
commit a5c735f5d9

View File

@ -72,6 +72,12 @@ void RtpReceiverDelegateAdapter::OnFirstPacketReceived(
self.receiverId];
}
- (void)dealloc {
if (_nativeRtpReceiver) {
_nativeRtpReceiver->SetObserver(nullptr);
}
}
- (BOOL)isEqual:(id)object {
if (self == object) {
return YES;