Fixed crash when PCF is destroyed before RTCRtpReceiver in ObjC
Bug: webrtc:9231 Change-Id: Ic532b7661bb8765f0fc2309d2ad530f664ccfd14 Reviewed-on: https://webrtc-review.googlesource.com/87840 Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23931}
This commit is contained in:
committed by
Commit Bot
parent
cd8f382557
commit
7a16c54571
@ -36,6 +36,7 @@ void RtpReceiverDelegateAdapter::OnFirstPacketReceived(
|
||||
} // namespace webrtc
|
||||
|
||||
@implementation RTCRtpReceiver {
|
||||
RTCPeerConnectionFactory *_factory;
|
||||
rtc::scoped_refptr<webrtc::RtpReceiverInterface> _nativeRtpReceiver;
|
||||
std::unique_ptr<webrtc::RtpReceiverDelegateAdapter> _observer;
|
||||
}
|
||||
@ -102,9 +103,11 @@ void RtpReceiverDelegateAdapter::OnFirstPacketReceived(
|
||||
return _nativeRtpReceiver;
|
||||
}
|
||||
|
||||
- (instancetype)initWithNativeRtpReceiver:
|
||||
(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver {
|
||||
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
|
||||
nativeRtpReceiver:
|
||||
(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver {
|
||||
if (self = [super init]) {
|
||||
_factory = factory;
|
||||
_nativeRtpReceiver = nativeRtpReceiver;
|
||||
RTCLogInfo(
|
||||
@"RTCRtpReceiver(%p): created receiver: %@", self, self.description);
|
||||
|
||||
Reference in New Issue
Block a user