RTCPeerConnection(objc): avoid leaking ICE candidate on addition.

BUG=2670
R=wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4379004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5199 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org 2013-12-02 18:49:54 +00:00
parent 8418e9696b
commit e0034557a7

View File

@ -117,9 +117,9 @@ class RTCSetSessionDescriptionObserver : public SetSessionDescriptionObserver {
}
- (BOOL)addICECandidate:(RTCICECandidate *)candidate {
const webrtc::IceCandidateInterface *iceCandidate = candidate.candidate;
return self.peerConnection->AddIceCandidate(iceCandidate);
delete iceCandidate;
talk_base::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate(
candidate.candidate);
return self.peerConnection->AddIceCandidate(iceCandidate.get());
}
- (BOOL)addStream:(RTCMediaStream *)stream