Fix cleanCurrentPeerConnections method.

Remove delegate for peer connections that are going to be closed.
Notifify call view about deleted peer connections with the delegate function.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2020-06-16 16:46:48 +02:00
Родитель 1883722885
Коммит 8ab7cf9ba1
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -256,6 +256,8 @@ static NSString * const kNCVideoTrackKind = @"video";
- (void)cleanCurrentPeerConnections - (void)cleanCurrentPeerConnections
{ {
for (NCPeerConnection *peerConnectionWrapper in [_connectionsDict allValues]) { for (NCPeerConnection *peerConnectionWrapper in [_connectionsDict allValues]) {
[self.delegate callController:self peerLeft:peerConnectionWrapper];
peerConnectionWrapper.delegate = nil;
[peerConnectionWrapper close]; [peerConnectionWrapper close];
} }
for (NSTimer *pendingOfferTimer in [_pendingOffersDict allValues]) { for (NSTimer *pendingOfferTimer in [_pendingOffersDict allValues]) {