[farsight2/master] Keep ref to participant when adding agents to it, only destroy it when all agents are gone

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:23 PST 2008


---
 transmitters/nice/fs-nice-stream-transmitter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index e21b66e..8b5d720 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -832,6 +832,7 @@ weak_agent_removed (gpointer user_data, GObject *where_the_object_was)
   agents = g_object_get_data (G_OBJECT (participant), "nice-agents");
   agents = g_list_remove (agents, where_the_object_was);
   g_object_set_data (G_OBJECT (participant), "nice-agents", agents);
+  g_object_unref (participant);
 }
 
 static gboolean
@@ -992,6 +993,7 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
     agents = g_list_prepend (agents, agent);
     g_object_set_data (G_OBJECT (participant), "nice-agents", agents);
     g_object_weak_ref (G_OBJECT (agent), weak_agent_removed, participant);
+    g_object_ref (participant);
 
     self->priv->agent = agent;
 
-- 
1.5.6.5




More information about the farsight-commits mailing list