summaryrefslogtreecommitdiff
path: root/agent/component.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-09-23 14:56:52 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-09-23 15:10:57 +0100
commit4441eea870b6b56b644a750430c145f0ecd7bf9e (patch)
treef4e5cf0080cda2900e91659c0f41dfebf96dc5be /agent/component.c
parent67392282f0715859576ce7bb781f18e4b86bf800 (diff)
downloadlibnice-4441eea870b6b56b644a750430c145f0ecd7bf9e.tar.gz
agent: Use g_slist_free_full() to reduce code
This introduces no functional changes.
Diffstat (limited to 'agent/component.c')
-rw-r--r--agent/component.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/agent/component.c b/agent/component.c
index ca4f209..a720b89 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -225,20 +225,9 @@ component_clear_selected_pair (Component *component)
void
component_close (Component *cmp)
{
- GSList *i;
IOCallbackData *data;
GOutputVector *vec;
- for (i = cmp->local_candidates; i; i = i->next) {
- NiceCandidate *candidate = i->data;
- nice_candidate_free (candidate);
- }
-
- for (i = cmp->remote_candidates; i; i = i->next) {
- NiceCandidate *candidate = i->data;
- nice_candidate_free (candidate);
- }
-
if (cmp->restart_candidate)
nice_candidate_free (cmp->restart_candidate),
cmp->restart_candidate = NULL;
@@ -247,9 +236,11 @@ component_close (Component *cmp)
nice_candidate_free (cmp->turn_candidate),
cmp->turn_candidate = NULL;
- g_slist_free (cmp->local_candidates);
+ g_slist_free_full (cmp->local_candidates,
+ (GDestroyNotify) nice_candidate_free);
cmp->local_candidates = NULL;
- g_slist_free (cmp->remote_candidates);
+ g_slist_free_full (cmp->remote_candidates,
+ (GDestroyNotify) nice_candidate_free);
cmp->remote_candidates = NULL;
component_free_socket_sources (cmp);
g_slist_free_full (cmp->incoming_checks,