Commit 891ce53e authored by Olivier Crête's avatar Olivier Crête

conncheck: Factor out stopping connectivity checks

parent 6c893546
...@@ -1406,6 +1406,17 @@ void conn_check_free_item (gpointer data, gpointer user_data) ...@@ -1406,6 +1406,17 @@ void conn_check_free_item (gpointer data, gpointer user_data)
g_slice_free (CandidateCheckPair, pair); g_slice_free (CandidateCheckPair, pair);
} }
static void
conn_check_stop (NiceAgent *agent)
{
if (agent->conncheck_timer_source == NULL)
return;
g_source_destroy (agent->conncheck_timer_source);
g_source_unref (agent->conncheck_timer_source);
agent->conncheck_timer_source = NULL;
}
/* /*
* Frees all resources of all connectivity checks. * Frees all resources of all connectivity checks.
*/ */
...@@ -1423,11 +1434,7 @@ void conn_check_free (NiceAgent *agent) ...@@ -1423,11 +1434,7 @@ void conn_check_free (NiceAgent *agent)
} }
} }
if (agent->conncheck_timer_source != NULL) { conn_check_stop (agent);
g_source_destroy (agent->conncheck_timer_source);
g_source_unref (agent->conncheck_timer_source);
agent->conncheck_timer_source = NULL;
}
} }
/* /*
......
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