Skip to content

Commit 68386ad

Browse files
committed
Cleanup conn_checks after closing local candidate
1 parent f9da7ca commit 68386ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/ex_ice/priv/ice_agent.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,19 @@ defmodule ExICE.Priv.ICEAgent do
19611961
other
19621962
end
19631963

1964+
conn_checks =
1965+
ice_agent.conn_checks
1966+
|> Enum.reject(fn {_, conn_check} ->
1967+
pair = Map.fetch!(ice_agent.checklist, conn_check.pair_id)
1968+
pair.local_cand_id == local_cand.base.id
1969+
end)
1970+
|> Map.new()
1971+
19641972
%{
19651973
ice_agent
19661974
| local_cands: local_cands,
19671975
selected_pair_id: selected_pair_id,
1976+
conn_checks: conn_checks,
19681977
checklist: Checklist.prune(ice_agent.checklist, local_cand),
19691978
nominating?: nominating?
19701979
}

0 commit comments

Comments
 (0)