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.
This commit is contained in:
Tim-Philipp Müller 2013-11-12 18:58:43 +00:00
parent cd52ff313e
commit 7509343e53

View file

@ -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);