summaryrefslogtreecommitdiff
path: root/agent/stream.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-08-26 09:30:26 +0100
committerOlivier Crête <olivier.crete@collabora.com>2014-08-27 15:28:20 -0400
commit56e04b56c394f992bccbd71a38b8aec9c5d0b518 (patch)
treed195c476ffabe8c4ec958d372478d33ccc957431 /agent/stream.c
parentc61f3780d1367e80f128972dc6ccd0f65a59ec64 (diff)
downloadlibnice-56e04b56c394f992bccbd71a38b8aec9c5d0b518.tar.gz
agent: Split component_free() into component_[close|free]()
Closing a component and freeing it are slightly conceptually different. As it happens, freeing it can result in the disposal of the component's NiceIOStream, which requires the agent lock to be released — but closing the rest of the Component requires the agent lock to be held. Splitting the function up simplifies locking handling in other parts of the code (see next commit).
Diffstat (limited to 'agent/stream.c')
-rw-r--r--agent/stream.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/agent/stream.c b/agent/stream.c
index 75c81c9..ecc333a 100644
--- a/agent/stream.c
+++ b/agent/stream.c
@@ -67,6 +67,17 @@ stream_new (guint n_components, NiceAgent *agent)
}
void
+stream_close (Stream *stream)
+{
+ GSList *i;
+
+ for (i = stream->components; i; i = i->next) {
+ Component *component = i->data;
+ component_close (component);
+ }
+}
+
+void
stream_free (Stream *stream)
{
GSList *i;