[farsight2/master] Fix small ref leak in the notifier

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


---
 gst-libs/gst/farsight/fs-element-added-notifier.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-element-added-notifier.c b/gst-libs/gst/farsight/fs-element-added-notifier.c
index 068040b..4b83b2f 100644
--- a/gst-libs/gst/farsight/fs-element-added-notifier.c
+++ b/gst-libs/gst/farsight/fs-element-added-notifier.c
@@ -154,6 +154,7 @@ static void
 _bin_unparented_cb (GstObject *object, GstObject *parent, gpointer user_data)
 {
   GstIterator *iter = NULL;
+  FsElementAddedNotifier *notifier = FS_ELEMENT_ADDED_NOTIFIER (user_data);
   gboolean done;
 
   /* Return if there was no handler connected */
@@ -170,10 +171,8 @@ _bin_unparented_cb (GstObject *object, GstObject *parent, gpointer user_data)
 
     switch (gst_iterator_next (iter, &item)) {
       case GST_ITERATOR_OK:
-        {
         if (GST_IS_BIN (item))
           _bin_unparented_cb (GST_OBJECT (item), object, user_data);
-        }
         break;
       case GST_ITERATOR_RESYNC:
         // We don't rollback anything, we just ignore already processed ones
@@ -190,6 +189,10 @@ _bin_unparented_cb (GstObject *object, GstObject *parent, gpointer user_data)
   }
 
   gst_iterator_free (iter);
+
+  g_object_weak_unref (G_OBJECT (object), (GWeakNotify) g_object_unref,
+      notifier);
+  g_object_unref (notifier);
 }
 
 
-- 
1.5.6.5




More information about the farsight-commits mailing list