From dd739adfa72066d51c1b9445b241e0e1c566c1c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 28 Dec 2007 13:57:05 +0000 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ tests/check/generic/sinks.c | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d934a0..e2e66eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-28 Tim-Philipp Müller + + * 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 Based on Patch by: Laurent Glayal diff --git a/tests/check/generic/sinks.c b/tests/check/generic/sinks.c index 13d274b..701d2c5 100644 --- a/tests/check/generic/sinks.c +++ b/tests/check/generic/sinks.c @@ -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); -- 2.7.4