Add refcounting around _iterate to guard against unreffing in scheduling callbacks...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 27 Feb 2003 18:18:32 +0000 (18:18 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 27 Feb 2003 18:18:32 +0000 (18:18 +0000)
Original commit message from CVS:
Add refcounting around _iterate to guard against unreffing in scheduling
callbacks or other nastyties

gst/gstbin.c

index 69e89fa..d269d8b 100644 (file)
@@ -979,6 +979,8 @@ gst_bin_iterate (GstBin *bin)
 
   oclass = GST_BIN_GET_CLASS (bin);
 
+  gst_object_ref (GST_OBJECT (bin));
+
   if (bin->pre_iterate_func)
     (bin->pre_iterate_func) (bin, bin->pre_iterate_data);
 
@@ -1000,6 +1002,7 @@ gst_bin_iterate (GstBin *bin)
       running = TRUE;
     }
   }
+  gst_object_unref (GST_OBJECT (bin));
 
   return running;
 }