tests: Fix more leaks

This commit is contained in:
Edward Hervey 2011-10-11 13:54:45 +02:00
parent a21008ff2e
commit e60fa7cb48
6 changed files with 20 additions and 8 deletions

View file

@ -59,12 +59,14 @@ setup (void)
for (f = features; f; f = f->next) {
GstPluginFeature *feature = f->data;
const gchar *name = gst_plugin_feature_get_name (feature);
gchar *name;
gboolean ignore = FALSE;
if (!GST_IS_ELEMENT_FACTORY (feature))
continue;
name = gst_plugin_feature_get_name (feature);
if (ignorelist) {
gchar **s;
@ -74,12 +76,14 @@ setup (void)
ignore = TRUE;
}
}
if (ignore)
if (ignore) {
g_free (name);
continue;
}
}
GST_DEBUG ("adding element %s", name);
elements = g_list_prepend (elements, (gpointer) g_strdup (name));
elements = g_list_prepend (elements, name);
}
gst_plugin_feature_list_free (features);
}

View file

@ -542,6 +542,8 @@ GST_START_TEST (send_custom_events)
gst_element_get_state (GST_ELEMENT (pipeline), NULL, NULL,
GST_CLOCK_TIME_NONE);
gst_object_unref (sinkpad);
gst_object_unref (srcpad);
gst_object_unref (pipeline);
}

View file

@ -241,6 +241,7 @@ GST_START_TEST (test_remove_target)
fail_unless (target == NULL);
gst_object_unref (b1);
gst_object_unref (ghost);
}
GST_END_TEST;
@ -717,6 +718,7 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
gst_object_unref (ghost);
gst_caps_unref (caps1);
gst_caps_unref (caps2);
/* source 2, setting the caps on the ghostpad does not influence the caps of
* the target */
@ -760,6 +762,7 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
gst_object_unref (ghost);
gst_caps_unref (caps1);
gst_caps_unref (caps2);
/* clear caps on pads */
gst_pad_set_active (src, FALSE);

View file

@ -218,9 +218,10 @@ static gboolean
name_is_valid (const gchar * name, GstPadPresence presence)
{
GstPadTemplate *new;
GstCaps *any = GST_CAPS_ANY;
GstCaps *any = gst_caps_new_any ();
new = gst_pad_template_new (name, GST_PAD_SRC, presence, any);
gst_caps_unref (any);
if (new) {
gst_object_unref (GST_OBJECT (new));
return TRUE;

View file

@ -501,6 +501,7 @@ GST_START_TEST (test_element_found_tags)
gst_element_set_state (pipeline, GST_STATE_PLAYING);
gst_element_found_tags (GST_ELEMENT (fakesrc), list);
gst_tag_list_free (list);
bus = gst_element_get_bus (pipeline);
message = gst_bus_poll (bus, GST_MESSAGE_EOS, -1);

View file

@ -759,14 +759,14 @@ GST_START_TEST (test_value_intersect)
g_value_unset (&src2);
g_value_init (&src1, G_TYPE_STRING);
g_value_set_string (&src1, "YUY2");
g_value_set_static_string (&src1, "YUY2");
g_value_init (&src2, GST_TYPE_LIST);
g_value_init (&item, G_TYPE_STRING);
g_value_set_string (&item, "YUY2");
g_value_set_static_string (&item, "YUY2");
gst_value_list_append_value (&src2, &item);
g_value_set_string (&item, "I420");
g_value_set_static_string (&item, "I420");
gst_value_list_append_value (&src2, &item);
g_value_set_string (&item, "ABCD");
g_value_set_static_string (&item, "ABCD");
gst_value_list_append_value (&src2, &item);
fail_unless (gst_value_intersect (&dest, &src1, &src2));
@ -775,6 +775,7 @@ GST_START_TEST (test_value_intersect)
g_value_unset (&src1);
g_value_unset (&src2);
g_value_unset (&dest);
}
GST_END_TEST;