tests/check/generic/sinks.c: Fix leak in unit test (bus sync handler must unref the message if it returns GST_BUS_DRO...

Original commit message from CVS:
* tests/check/generic/sinks.c: (async_done_func),
(async_done_eos_func):
Fix leak in unit test (bus sync handler must unref the message
if it returns GST_BUS_DROP). Don't fiddle with the default test
timeout, this is smaller than the current preconfigured value
via CK_DEFAULT_TIMEOUT, and also breaks things with valgrind
because it overrides the value specified in CK_DEFAULT_TIMEOUT.
This commit is contained in:
Tim-Philipp Müller 2007-12-28 13:57:05 +00:00
parent 8041250ee7
commit dd739adfa7
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2007-12-28 Tim-Philipp Müller <tim at centricular dot net>
* tests/check/generic/sinks.c: (async_done_func),
(async_done_eos_func):
Fix leak in unit test (bus sync handler must unref the message
if it returns GST_BUS_DROP). Don't fiddle with the default test
timeout, this is smaller than the current preconfigured value
via CK_DEFAULT_TIMEOUT, and also breaks things with valgrind
because it overrides the value specified in CK_DEFAULT_TIMEOUT.
2007-12-24 Wim Taymans <wim.taymans@collabora.co.uk>
Based on Patch by: Laurent Glayal <spglegle at yahoo dot fr>

View file

@ -1008,6 +1008,9 @@ async_done_func (GstBus * bus, GstMessage * msg, GstElement * sink)
fail_unless (position == 10 * GST_SECOND, "position is wrong");
}
/* we must unref the message if we return DROP */
gst_message_unref (msg);
/* we can drop the message, nothing is listening for it. */
return GST_BUS_DROP;
}
@ -1167,6 +1170,8 @@ async_done_eos_func (GstBus * bus, GstMessage * msg, GstElement * sink)
fail_unless (position == 10 * GST_SECOND, "position is wrong");
}
/* we must unref the message if we return DROP */
gst_message_unref (msg);
/* we can drop the message, nothing is listening for it. */
return GST_BUS_DROP;
}
@ -1245,9 +1250,6 @@ gst_sinks_suite (void)
Suite *s = suite_create ("Sinks");
TCase *tc_chain = tcase_create ("general");
/* time out after 10s, not the default 3, we need this for the last test. */
tcase_set_timeout (tc_chain, 10);
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_sink);
tcase_add_test (tc_chain, test_sink_completion);