component.c 664 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

#include "component.h"

Component *
component_new (
  G_GNUC_UNUSED
  ComponentType type)
{
  Component *component;

  component = g_slice_new0 (Component);
  component->id = 1;
  return component;
}


void
component_free (Component *cmp)
{
  GSList *i;

  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);
    }

  g_slist_free (cmp->local_candidates);
  g_slist_free (cmp->remote_candidates);
  g_slice_free (Component, cmp);
}