Respond to CR.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-02-03 11:29:40 -05:00
parent 732144c9ed
commit 6e390d40b7

View file

@ -1064,23 +1064,11 @@ protocol CallServiceObserver: class {
remoteVideoTrack = nil
isRemoteVideoEnabled = false
// We make a local copy of peerConnectionClient and then clear
// the peerConnectionClient property immediately. This class'
// PeerConnectionClientDelegate methods exit early if their
// peerConnectionClient argument doesn't match the peerConnectionClient
// property.
//
// In practice this won't matter, since PeerConnectionClient invokes
// its delegate methods asynchronously, but we don't want to bake that
// assumption into this logic.
var peerConnectionClientCopy = peerConnectionClient
PeerConnectionClient.stopAudioSession()
peerConnectionClient?.terminate()
Logger.debug("\(TAG) setting peerConnectionClient in \(#function)")
peerConnectionClient = nil
PeerConnectionClient.stopAudioSession()
peerConnectionClientCopy?.terminate()
peerConnectionClientCopy = nil
call?.removeAllObservers()
call = nil
thread = nil