check: Don't assume gst_pad_get_peer returns non NULL value.

This commit is contained in:
Stefan Kost 2009-02-04 16:07:30 +02:00
parent 09eb9d797d
commit f207841b89

View file

@ -216,6 +216,7 @@ gst_check_teardown_pad_by_name (GstElement * element, gchar * name)
ASSERT_OBJECT_REFCOUNT (pad_element, "pad", 2);
pad_peer = gst_pad_get_peer (pad_element);
if (pad_peer) {
if (gst_pad_get_direction (pad_element) == GST_PAD_SINK)
gst_pad_unlink (pad_peer, pad_element);
else
@ -223,17 +224,20 @@ gst_check_teardown_pad_by_name (GstElement * element, gchar * name)
/* caps could have been set, make sure they get unset */
gst_pad_set_caps (pad_peer, NULL);
}
/* pad refs held by both creator and this function (through _get) */
ASSERT_OBJECT_REFCOUNT (pad_element, "element pad_element", 2);
gst_object_unref (pad_element);
/* one more ref is held by element itself */
if (pad_peer) {
/* pad refs held by both creator and this function (through _get_peer) */
ASSERT_OBJECT_REFCOUNT (pad_peer, "check pad_peer", 2);
gst_object_unref (pad_peer);
gst_object_unref (pad_peer);
}
}
void
gst_check_teardown_src_pad (GstElement * element)