Making sure the instance is created before running cleaup

This commit is contained in:
Vitor Pamplona
2026-04-03 14:32:36 -04:00
parent 32f6815fb5
commit 397cdb6a6b
@@ -90,6 +90,9 @@ class CallController(
private val peerSessions = ConcurrentHashMap<HexKey, PeerSessionState>()
// Candidates received before a PeerSession exists for the sender
private val globalPendingIce = ConcurrentHashMap<HexKey, CopyOnWriteArrayList<IceCandidate>>()
// ---- Shared WebRTC resources ----
private var peerConnectionFactory: PeerConnectionFactory? = null
@@ -398,9 +401,6 @@ class CallController(
}
}
// Candidates received before a PeerSession exists for the sender
private val globalPendingIce = ConcurrentHashMap<HexKey, CopyOnWriteArrayList<IceCandidate>>()
private fun getGlobalPendingCandidates(peerPubKey: HexKey): List<IceCandidate> = globalPendingIce.remove(peerPubKey)?.toList() ?: emptyList()
private fun flushPendingIceCandidates(