tests/check/generic/sinks.c: Fix leak in unit test (bus sync handler must unref the...
authorTim-Philipp Müller <tim@centricular.net>
Fri, 28 Dec 2007 13:57:05 +0000 (13:57 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Fri, 28 Dec 2007 13:57:05 +0000 (13:57 +0000)
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
tests/check/generic/sinks.c

index 4d934a0..e2e66eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
index 13d274b..701d2c5 100644 (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);