From: Wim Taymans Date: Mon, 20 Jul 2009 13:44:36 +0000 (+0200) Subject: task: fix taskpool leak X-Git-Tag: RELEASE-0.10.24~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a78199ae5e48cabec1ed5c733e84debfc55578ca;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/gst/gsttask.c b/gst/gsttask.c index 662a4f7..5ab1c03 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -749,16 +749,15 @@ gst_task_join (GstTask * task) /* clean the thread */ task->abidata.ABI.thread = NULL; /* get the id and pool to join */ - if ((id = priv->id)) { - if ((pool = priv->pool_id)) - gst_object_ref (pool); - priv->pool_id = NULL; - priv->id = NULL; - } + pool = priv->pool_id; + id = priv->id; + priv->pool_id = NULL; + priv->id = NULL; GST_OBJECT_UNLOCK (task); if (pool) { - gst_task_pool_join (pool, id); + if (id) + gst_task_pool_join (pool, id); gst_object_unref (pool); }