Make get_flex_version.py script executable
[platform/upstream/gstreamer.git] / gst / gstiterator.c
index 77f0c02..e7e5875 100644 (file)
@@ -22,6 +22,7 @@
 
 /**
  * SECTION:gstiterator
+ * @title: GstIterator
  * @short_description: Object to retrieve multiple elements in a threadsafe
  * way.
  * @see_also: #GstElement, #GstBin
@@ -227,7 +228,7 @@ gst_list_iterator_free (GstListIterator * it)
  * Create a new iterator designed for iterating @list.
  *
  * The list you iterate is usually part of a data structure @owner and is
- * protected with @lock. 
+ * protected with @lock.
  *
  * The iterator will use @lock to retrieve the next item of the list and it
  * will then call the @item function before releasing @lock again.
@@ -296,7 +297,7 @@ gst_iterator_pop (GstIterator * it)
  * @it: The #GstIterator to iterate
  * @elem: (out caller-allocates): pointer to hold next element
  *
- * Get the next item from the iterator in @elem. 
+ * Get the next item from the iterator in @elem.
  *
  * Only when this function returns %GST_ITERATOR_OK, @elem will contain a valid
  * value. @elem must have been initialized to the type of the iterator or
@@ -309,7 +310,7 @@ gst_iterator_pop (GstIterator * it)
  *
  * A return value of %GST_ITERATOR_RESYNC indicates that the element list was
  * concurrently updated. The user of @it should call gst_iterator_resync() to
- * get the newly updated list. 
+ * get the newly updated list.
  *
  * A return value of %GST_ITERATOR_ERROR indicates an unrecoverable fatal error.
  *
@@ -607,6 +608,8 @@ gst_iterator_fold (GstIterator * it, GstIteratorFoldFunction func,
   GValue item = { 0, };
   GstIteratorResult result;
 
+  g_return_val_if_fail (it != NULL, GST_ITERATOR_ERROR);
+
   while (1) {
     result = gst_iterator_next (it, &item);
     switch (result) {
@@ -625,7 +628,13 @@ gst_iterator_fold (GstIterator * it, GstIteratorFoldFunction func,
   }
 
 fold_done:
+
+#if GLIB_CHECK_VERSION (2, 48, 0)
   g_value_unset (&item);
+#else
+  if (item.g_type != 0)
+    g_value_unset (&item);
+#endif
 
   return result;
 }