Commit e20deca8 authored by Dafydd Harries's avatar Dafydd Harries

free unused candidates safely

darcs-hash:20070213122313-c9803-902bedac1524d491e2c071e496a620120ed130f6.gz
parent 9cf25794
...@@ -277,20 +277,19 @@ nice_agent_remove_stream ( ...@@ -277,20 +277,19 @@ nice_agent_remove_stream (
{ {
GSList *i; GSList *i;
GSList *candidates = agent->local_candidates; GSList *old_list = agent->local_candidates;
GSList *new_list = NULL;
for (i = agent->local_candidates; i; i = i->next) for (i = agent->local_candidates; i; i = i->next)
{ {
NiceCandidate *candidate = i->data; NiceCandidate *candidate = i->data;
if (candidate->stream_id == stream_id) if (candidate->stream_id != stream_id)
{ new_list = g_slist_append (new_list, candidate);
candidates = g_slist_remove (candidates, candidate);
nice_candidate_free (candidate);
}
} }
agent->local_candidates = candidates; agent->local_candidates = new_list;
g_slist_free (old_list);
} }
/* remove stream */ /* remove stream */
......
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