Fix splitting control bindings leaks
authorThibault Saunier <tsaunier@igalia.com>
Thu, 28 Mar 2019 14:29:05 +0000 (11:29 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Mon, 15 Apr 2019 21:11:48 +0000 (17:11 -0400)
ges/ges-track-element.c
tests/check/ges/clip.c

index ca18bd5..d7006b3 100644 (file)
@@ -424,6 +424,7 @@ _update_control_bindings (GESTimelineElement * element, GstClockTime inpoint,
       if (next->timestamp > inpoint)
         break;
     }
+    g_list_free (values);
 
     value_at_pos =
         interpolate_values_for_position (first, next, inpoint, absolute);
@@ -443,6 +444,7 @@ _update_control_bindings (GESTimelineElement * element, GstClockTime inpoint,
         if (prev->timestamp < duration + inpoint)
           break;
       }
+      g_list_free (values);
 
       value_at_pos =
           interpolate_values_for_position (prev, last, duration + inpoint,
@@ -464,6 +466,7 @@ _update_control_bindings (GESTimelineElement * element, GstClockTime inpoint,
           && value->timestamp > duration + inpoint)
         gst_timed_value_control_source_unset (source, value->timestamp);
     }
+    g_list_free (values);
   }
 
   g_free (specs);
@@ -1246,6 +1249,7 @@ _split_binding (GESTrackElement * element, GESTrackElement * new_element,
     last_value = value;
 
   }
+  g_list_free (values);
 }
 
 static void
@@ -1264,6 +1268,7 @@ _copy_binding (GESTrackElement * element, GESTrackElement * new_element,
     gst_timed_value_control_source_set (new_source, value->timestamp,
         value->value);
   }
+  g_list_free (values);
 }
 
 /* position == GST_CLOCK_TIME_NONE means that we do a simple copy
index 5068cba..6b1ce79 100644 (file)
@@ -187,6 +187,7 @@ GST_START_TEST (test_split_direct_bindings)
 
   CHECK_OBJECT_PROPS (clip, 0 * GST_SECOND, 10 * GST_SECOND, 5 * GST_SECOND);
   check_layer (clip, 0);
+  gst_object_unref (timeline);
 
   ges_deinit ();
 }
@@ -276,6 +277,7 @@ GST_START_TEST (test_split_direct_absolute_bindings)
   CHECK_OBJECT_PROPS (clip, 0 * GST_SECOND, 10 * GST_SECOND, 5 * GST_SECOND);
   check_layer (clip, 0);
 
+  gst_object_unref (timeline);
   ges_deinit ();
 }