Commit 754596c8 authored by Philip Withnall's avatar Philip Withnall Committed by Olivier Crête

agent: Fix locking when calling component_free()

As mentioned in the previous commit message, component_free() requires
the agent lock to be released, but component_close() requires it to be
held. Fix the locking in nice_agent_remove_stream() to do that.
parent 56e04b56
......@@ -2890,7 +2890,6 @@ nice_agent_remove_stream (
/* Remove the stream and signal its removal. */
agent->streams = g_slist_remove (agent->streams, stream);
stream_close (stream);
stream_free (stream);
if (!agent->streams)
priv_remove_keepalive_timer (agent);
......@@ -2899,6 +2898,12 @@ nice_agent_remove_stream (
g_memdup (stream_ids, sizeof(stream_ids)));
agent_unlock_and_emit (agent);
/* Actually free the stream. This should be done with the lock released, as
* it could end up disposing of a NiceIOStream, which tries to take the
* agent lock itself. */
stream_free (stream);
return;
}
......
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