From 88994eac6764350dd34b1abb98aead1d03062045 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Tue, 22 Mar 2022 17:50:29 +0400 Subject: [PATCH] Fix race condition --- .../TelegramCore/Sources/State/CallSessionManager.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramCore/Sources/State/CallSessionManager.swift b/submodules/TelegramCore/Sources/State/CallSessionManager.swift index 16cd09f66f..1f7e2ebeff 100644 --- a/submodules/TelegramCore/Sources/State/CallSessionManager.swift +++ b/submodules/TelegramCore/Sources/State/CallSessionManager.swift @@ -537,7 +537,9 @@ private final class CallSessionManagerContext { guard let strongSelf = self else { return } - strongSelf.drop(internalId: internalId, reason: .disconnect, debugLog: .single(nil)) + strongSelf.contexts.removeValue(forKey: internalId) + strongSelf.contextIdByStableId.removeValue(forKey: stableId) + strongSelf.ringingStatesUpdated() } })) self.contextIdByStableId[stableId] = internalId