gst/gstminiobject.c: Taking a NULL miniobject is valid, fix the case where we try...
authorWim Taymans <wim.taymans@gmail.com>
Fri, 28 Apr 2006 13:10:07 +0000 (13:10 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 28 Apr 2006 13:10:07 +0000 (13:10 +0000)
Original commit message from CVS:
* gst/gstminiobject.c: (gst_value_take_mini_object):
Taking a NULL miniobject is valid, fix the case where
we try to unref the NULL miniobject.

ChangeLog
gst/gstminiobject.c

index ed4776a..a6cb633 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-28  Wim Taymans  <wim@fluendo.com>
 
+       * gst/gstminiobject.c: (gst_value_take_mini_object):
+       Taking a NULL miniobject is valid, fix the case where
+       we try to unref the NULL miniobject.
+
+2006-04-28  Wim Taymans  <wim@fluendo.com>
+
        Patch by: Stefan Kost <ensonic at sonicpulse dot de>
 
        * gst/gstbin.c: (gst_bin_handle_message_func):
index 2e0569e..279ec73 100644 (file)
@@ -425,8 +425,11 @@ gst_value_take_mini_object (GValue * value, GstMiniObject * mini_object)
   g_return_if_fail (mini_object == NULL || GST_IS_MINI_OBJECT (mini_object));
 
   pointer_p = &value->data[0].v_pointer;
+  /* takes additional refcount */
   gst_mini_object_replace ((GstMiniObject **) pointer_p, mini_object);
-  gst_mini_object_unref (mini_object);
+  /* remove additional refcount */
+  if (mini_object)
+    gst_mini_object_unref (mini_object);
 }
 
 /**