mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 02:13:46 +00:00
adaptivedemux: make sure task has stopped before freeing it
Otherwise the thread will be running and its memory will get freed. This leads to memory corruption
This commit is contained in:
parent
0bef1974e2
commit
3dfab51b92
1 changed files with 3 additions and 3 deletions
|
@ -733,10 +733,10 @@ gst_adaptive_demux_stream_free (GstAdaptiveDemuxStream * stream)
|
||||||
|
|
||||||
g_cond_signal (&stream->fragment_download_cond);
|
g_cond_signal (&stream->fragment_download_cond);
|
||||||
gst_task_stop (stream->download_task);
|
gst_task_stop (stream->download_task);
|
||||||
GST_LOG_OBJECT (demux, "Waiting for task to finish");
|
|
||||||
gst_task_join (stream->download_task);
|
|
||||||
GST_LOG_OBJECT (demux, "Finished");
|
|
||||||
}
|
}
|
||||||
|
GST_LOG_OBJECT (demux, "Waiting for task to finish");
|
||||||
|
gst_task_join (stream->download_task);
|
||||||
|
GST_LOG_OBJECT (demux, "Finished");
|
||||||
gst_object_unref (stream->download_task);
|
gst_object_unref (stream->download_task);
|
||||||
g_rec_mutex_clear (&stream->download_lock);
|
g_rec_mutex_clear (&stream->download_lock);
|
||||||
stream->download_task = NULL;
|
stream->download_task = NULL;
|
||||||
|
|
Loading…
Reference in a new issue