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 { - (BOOL)addICECandidate:(RTCICECandidate *)candidate {
const webrtc::IceCandidateInterface *iceCandidate = candidate.candidate; talk_base::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate(
return self.peerConnection->AddIceCandidate(iceCandidate); candidate.candidate);
delete iceCandidate; return self.peerConnection->AddIceCandidate(iceCandidate.get());
} }
- (BOOL)addStream:(RTCMediaStream *)stream - (BOOL)addStream:(RTCMediaStream *)stream