[farsight2/master] Keep a ref to the nice elements

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


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

diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c
index 03d4865..a6d508b 100644
--- a/transmitters/nice/fs-nice-transmitter.c
+++ b/transmitters/nice/fs-nice-transmitter.c
@@ -515,6 +515,8 @@ _create_sinksource (
     return NULL;
   }
 
+  gst_object_ref (elem);
+
   if (direction == GST_PAD_SINK)
     *requested_pad = gst_element_get_request_pad (teefunnel, "src%d");
   else
@@ -596,6 +598,8 @@ _create_sinksource (
 
   if (elempad)
     gst_object_unref (elempad);
+  if (elem)
+    gst_object_unref (elem);
 
   return NULL;
 }
@@ -687,6 +691,7 @@ fs_nice_transmitter_free_gst_stream (FsNiceTransmitter *self,
             gst_element_state_change_return_get_name (ret));
       if (!gst_bin_remove (GST_BIN (self->priv->gst_src), ns->nicesrcs[c]))
         GST_ERROR ("Could not remove nicesrc element from transmitter source");
+      gst_object_unref (ns->nicesrcs[c]);
     }
 
     if (ns->requested_funnel_pads[c])
@@ -706,6 +711,7 @@ fs_nice_transmitter_free_gst_stream (FsNiceTransmitter *self,
             gst_element_state_change_return_get_name (ret));
       if (!gst_bin_remove (GST_BIN (self->priv->gst_sink), ns->nicesinks[c]))
         GST_ERROR ("Could not remove nicesink element from transmitter source");
+      gst_object_unref (ns->nicesinks[c]);
     }
 
     if (ns->requested_tee_pads[c])
-- 
1.5.6.5




More information about the farsight-commits mailing list