Commit 948bdce7 authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête

agent: Ensure Component.selected_pair is cleaned when freeing candidates

When freeing candidates (component_free_socket_sources()), the sockets
which back Component.selected_pair.[local|remote] are closed and their
addresses destroyed. Component.selected_pair should be cleared as well
to allow calling code to condition on (Component.selected_pair == NULL)
to see if it’s invalid.
parent 02a3786f
......@@ -246,12 +246,6 @@ component_free (Component *cmp)
component_clean_turn_servers (cmp);
if (cmp->selected_pair.keepalive.tick_source != NULL) {
g_source_destroy (cmp->selected_pair.keepalive.tick_source);
g_source_unref (cmp->selected_pair.keepalive.tick_source);
cmp->selected_pair.keepalive.tick_source = NULL;
}
if (cmp->tcp_clock) {
g_source_destroy (cmp->tcp_clock);
g_source_unref (cmp->tcp_clock);
......@@ -604,6 +598,8 @@ component_free_socket_sources (Component *component)
(GDestroyNotify) socket_source_free);
component->socket_sources = NULL;
component->socket_sources_age++;
component_clear_selected_pair (component);
}
GMainContext *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment