From 7509343e53dbabbde7bb728becc9bc2fc9a2808a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 12 Nov 2013 18:58:43 +0000 Subject: [PATCH] tests: fix race in streamsynchronizer test Wait for thread to exit before starting to free the to_push list, otherwise thread might check the final to_push->next node only after we've freed it already. --- tests/check/elements/streamsynchronizer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/check/elements/streamsynchronizer.c b/tests/check/elements/streamsynchronizer.c index c723591..87a14ff 100644 --- a/tests/check/elements/streamsynchronizer.c +++ b/tests/check/elements/streamsynchronizer.c @@ -162,7 +162,7 @@ my_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) return TRUE; } -static void +static gpointer my_push_thread (MyPushInfo * pushinfo) { GList *tmp; @@ -174,6 +174,9 @@ my_push_thread (MyPushInfo * pushinfo) else gst_pad_push (pushinfo->pad, GST_BUFFER (tmp->data)); } + + GST_INFO ("leaving thread"); + return NULL; } GST_START_TEST (test_basic) @@ -272,6 +275,9 @@ GST_START_TEST (test_basic) fail_if (expected != NULL); + /* wait for thread to exit before freeing things */ + g_thread_join (thread); + /* Cleanup */ g_list_free (to_push); gst_element_release_request_pad (synchr, sinkpad); -- 2.7.4