CR: use weak capture

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 30b50e1489
commit 86c1a3d08a

@ -721,9 +721,11 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
let pendingMessages = self.pendingDataChannelMessages
self.pendingDataChannelMessages = []
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
pendingMessages.forEach { message in
self.sendDataChannelMessage(data: message.data, description: message.description, isCritical: message.isCritical)
strongSelf.sendDataChannelMessage(data: message.data, description: message.description, isCritical: message.isCritical)
}
}
}

Loading…
Cancel
Save