mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 21:51:09 +00:00
task: fix taskpool leak
GstTaks does not always unref the taskpool it was created from because it depends on when the pool provided an ID for joining the task. Rework some code so that we always unref the pool and optionally join when the pool provided an id. Fixes #589127
This commit is contained in:
parent
141e2af580
commit
a78199ae5e
1 changed files with 6 additions and 7 deletions
|
@ -749,15 +749,14 @@ gst_task_join (GstTask * task)
|
||||||
/* clean the thread */
|
/* clean the thread */
|
||||||
task->abidata.ABI.thread = NULL;
|
task->abidata.ABI.thread = NULL;
|
||||||
/* get the id and pool to join */
|
/* get the id and pool to join */
|
||||||
if ((id = priv->id)) {
|
pool = priv->pool_id;
|
||||||
if ((pool = priv->pool_id))
|
id = priv->id;
|
||||||
gst_object_ref (pool);
|
|
||||||
priv->pool_id = NULL;
|
priv->pool_id = NULL;
|
||||||
priv->id = NULL;
|
priv->id = NULL;
|
||||||
}
|
|
||||||
GST_OBJECT_UNLOCK (task);
|
GST_OBJECT_UNLOCK (task);
|
||||||
|
|
||||||
if (pool) {
|
if (pool) {
|
||||||
|
if (id)
|
||||||
gst_task_pool_join (pool, id);
|
gst_task_pool_join (pool, id);
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue