mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
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:
parent
cd52ff313e
commit
7509343e53
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue