RTCPeerConnection throws KeyNotFoundException below when firing the callback after disposing the its instance.
KeyNotFoundException: The given key was not present in the dictionary. at
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00000] in
<00000000000000000000000000000000>:0 at Unity.WebRTC.RTCPeerConnection.FindObserver[T] (System.IntPtr ptr) [0x00000]
in <00000000000000000000000000000000>:0 at Unity.WebRTC.WebRTC+<>c__DisplayClass32_0.
<OnSetRemoteDescription>b__0 () [0x00000] in <00000000000000000000000000000000>:0 at
Unity.WebRTC.WebRTC.SendOrPostCallback (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at
Unity.WebRTC.ExecutableUnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in
<00000000000000000000000000000000>:0 at Unity.WebRTC.ExecutableUnitySynchronizationContext.Execute () [0x00000] in
<00000000000000000000000000000000>:0 at
Unity.WebRTC.ExecutableUnitySynchronizationContext.ExecuteAndAppendNextExecute () [0x00000] in
<00000000000000000000000000000000>:0 at Unity.WebRTC.ExecutableUnitySynchronizationContext.SendOrPostCallback
(System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at
UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0 at
UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <00000000000000000000000000000000>:0
RTCPeerConnection throws KeyNotFoundException below when firing the callback after disposing the its instance.
Fixed the issue using
TryGetValue
.