From: Sebastian Dröge Date: Wed, 2 Jan 2019 21:35:11 +0000 (+0200) Subject: pipeline: Call gst_task_cleanup_all() before checking reference counts after shutdown X-Git-Tag: 1.16.2~152 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fgstreamer.git;a=commitdiff_plain;h=74b9e72ec6b0963661c5c370e634f6fc9444057f pipeline: Call gst_task_cleanup_all() before checking reference counts after shutdown We have to ensure that all background threads from thread pools are shut down, or otherwise they might not have had a chance yet to drop their last reference to the pipeline and then the assertion for a reference count of 1 on the pipeline fails. --- diff --git a/tests/check/gst/gstpipeline.c b/tests/check/gst/gstpipeline.c index 7d83b02..e4951f8 100644 --- a/tests/check/gst/gstpipeline.c +++ b/tests/check/gst/gstpipeline.c @@ -223,6 +223,12 @@ GST_START_TEST (test_bus) fail_unless (ret == GST_STATE_CHANGE_SUCCESS); fail_unless (current == GST_STATE_NULL, "state is not NULL but %d", current); + /* We have to ensure that all background threads from thread pools are shut + * down, or otherwise they might not have had a chance yet to drop + * their last reference to the pipeline and then the assertion below fails + */ + gst_task_cleanup_all (); + ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline at start of cleanup", 1); ASSERT_OBJECT_REFCOUNT (bus, "bus at start of cleanup", 3);