From bd1d03202bdd278df7db3558e9df49082ade485d Mon Sep 17 00:00:00 2001 From: Justin Kim Date: Tue, 22 Sep 2015 23:10:35 +0900 Subject: [PATCH] nle{composition,object}: remove unused allocation & trivial leakages nlecomposition allocates unused 'UpdateCompositionData' and it causes leakages. https://bugzilla.gnome.org/show_bug.cgi?id=755417 --- plugins/nle/nlecomposition.c | 8 ++------ plugins/nle/nleobject.c | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/nle/nlecomposition.c b/plugins/nle/nlecomposition.c index 5bea068..e204501 100644 --- a/plugins/nle/nlecomposition.c +++ b/plugins/nle/nlecomposition.c @@ -396,6 +396,7 @@ _start_task (NleComposition * comp) gst_task_set_lock (task, GET_TASK_LOCK (comp)); GST_DEBUG_OBJECT (comp, "created task %p", task); comp->task = task; + g_free (taskname); } gst_task_set_state (task, GST_TASK_STARTED); @@ -760,11 +761,11 @@ _add_action (NleComposition * comp, GCallback func, Action *action; NleCompositionPrivate *priv = comp->priv; - action = (Action *) g_closure_new_simple (sizeof (Action), data); g_closure_add_finalize_notifier ((GClosure *) action, data, (GClosureNotify) _free_action); ACTION_CALLBACK (action) = func; + action->priority = priority; g_closure_set_marshal ((GClosure *) action, g_cclosure_marshal_VOID__VOID); @@ -2873,16 +2874,11 @@ update_pipeline (NleComposition * comp, GstClockTime currenttime, gint32 seqnum, priv->current = stack; if (priv->current) { - UpdateCompositionData *ucompo = g_slice_new0 (UpdateCompositionData); GST_INFO_OBJECT (comp, "New stack set and ready to run, probing src pad" " and stopping children thread until we are actually ready with" " that new stack"); - ucompo->comp = comp; - ucompo->reason = update_reason; - ucompo->seqnum = seqnum; - comp->priv->updating_reason = update_reason; comp->priv->seqnum_to_restart_task = seqnum; diff --git a/plugins/nle/nleobject.c b/plugins/nle/nleobject.c index bccf8d2..e8db1db 100644 --- a/plugins/nle/nleobject.c +++ b/plugins/nle/nleobject.c @@ -608,8 +608,7 @@ nle_object_change_state (GstElement * element, GstStateChange transition) /* Going to READY and if we are not in a composition, we need to make * sure that the object positioning state is properly commited */ if (parent) { - if (g_strcmp0 (gst_element_get_name (GST_ELEMENT (parent)), - "current-bin") + if (g_strcmp0 (GST_ELEMENT_NAME (GST_ELEMENT (parent)), "current-bin") && !NLE_OBJECT_IS_COMPOSITION (NLE_OBJECT (element))) { GST_INFO ("Adding nleobject to something that is not a composition," " commiting ourself"); -- 2.7.4