[farsight2/master] Have the rtp stream and rtp session hold hard refs to the parent objects

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


---
 gst/fsrtpconference/fs-rtp-session.c |    8 +++++++-
 gst/fsrtpconference/fs-rtp-stream.c  |    8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 83029de..909dfef 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -434,6 +434,12 @@ fs_rtp_session_dispose (GObject *object)
     self->priv->blueprints = NULL;
   }
 
+  if (self->priv->conference)
+  {
+    g_object_unref (self->priv->conference);
+    self->priv->conference = NULL;
+  }
+
   /* MAKE sure dispose does not run twice. */
   self->priv->disposed = TRUE;
 
@@ -561,7 +567,7 @@ fs_rtp_session_set_property (GObject *object,
       }
       break;
     case PROP_CONFERENCE:
-      self->priv->conference = g_value_get_object (value);
+      self->priv->conference = g_value_dup_object (value);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index a88f846..f178b54 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -231,6 +231,12 @@ fs_rtp_stream_dispose (GObject *object)
   /* Make sure dispose does not run twice. */
   self->priv->disposed = TRUE;
 
+  if (self->priv->session)
+  {
+    g_object_unref (self->priv->session);
+    self->priv->session = NULL;
+  }
+
   parent_class->dispose (object);
 }
 
@@ -285,7 +291,7 @@ fs_rtp_stream_set_property (GObject *object,
 
   switch (prop_id) {
     case PROP_SESSION:
-      self->priv->session = FS_RTP_SESSION (g_value_get_object (value));
+      self->priv->session = FS_RTP_SESSION (g_value_dup_object (value));
       break;
     case PROP_PARTICIPANT:
       self->priv->participant = FS_RTP_PARTICIPANT (g_value_dup_object (value));
-- 
1.5.6.5




More information about the farsight-commits mailing list