nle{composition,object}: remove unused allocation & trivial leakages
authorJustin Kim <justin.kim@collabora.com>
Tue, 22 Sep 2015 14:10:35 +0000 (23:10 +0900)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 24 Sep 2015 11:05:55 +0000 (13:05 +0200)
nlecomposition allocates unused 'UpdateCompositionData' and it
causes leakages.

https://bugzilla.gnome.org/show_bug.cgi?id=755417

plugins/nle/nlecomposition.c
plugins/nle/nleobject.c

index 5bea068..e204501 100644 (file)
@@ -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;
 
index bccf8d2..e8db1db 100644 (file)
@@ -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");