PeerConnection(iOS): make ARC-clean talk/.../objc* and talk/examples/ios
- Removes a strong-reference cycle between RTCPeerConnection and
RTCPeerConnectionObserver
- Gives RTCPeerConnectionObserver a virtual dtor
- Ensures RTCPeerConnectionTest tears down correctly
- Ensures AppRTCDemo tears down correctly
This is the talk/ half; the webrtc/ half is in https://webrtc-codereview.appspot.com/10539005
BUG=3054,3055,3100
R=noahric@google.com
Review URL: https://webrtc-codereview.appspot.com/10499005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5771 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m b/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m
index ee36604..8610477 100644
--- a/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m
+++ b/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m
@@ -246,12 +246,12 @@
RTCVideoCapturer* capturer =
[RTCVideoCapturer capturerWithDeviceName:cameraID];
- RTCVideoSource* videoSource = [self.peerConnectionFactory
+ self.videoSource = [self.peerConnectionFactory
videoSourceWithCapturer:capturer
constraints:self.client.videoConstraints];
RTCVideoTrack* localVideoTrack =
[self.peerConnectionFactory videoTrackWithID:@"ARDAMSv0"
- source:videoSource];
+ source:self.videoSource];
if (localVideoTrack) {
[lms addVideoTrack:localVideoTrack];
}
@@ -485,9 +485,10 @@
sendData:[@"{\"type\": \"bye\"}" dataUsingEncoding:NSUTF8StringEncoding]];
[self.peerConnection close];
self.peerConnection = nil;
- self.peerConnectionFactory = nil;
self.pcObserver = nil;
self.client = nil;
+ self.videoSource = nil;
+ self.peerConnectionFactory = nil;
[RTCPeerConnectionFactory deinitializeSSL];
}
@@ -523,8 +524,8 @@
#pragma mark - public methods
- (void)closeVideoUI {
- [self disconnect];
[self.viewController resetUI];
+ [self disconnect];
}
@end