libs/gst/controller/gstcontroller.c: Free allocated GstTimedValues when freeing list...
authorTim-Philipp Müller <tim@centricular.net>
Wed, 12 Apr 2006 10:28:53 +0000 (10:28 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 12 Apr 2006 10:28:53 +0000 (10:28 +0000)
Original commit message from CVS:
* libs/gst/controller/gstcontroller.c: (gst_controller_unset),
(gst_controller_unset_all):
Free allocated GstTimedValues when freeing list nodes.
Should fix leaks 'make check-valgrind' complains about.
* win32/common/libgstcontroller.def:
Add gst_controller_unset_all.

ChangeLog
libs/gst/controller/gstcontroller.c
win32/common/libgstcontroller.def

index 5189c8d..c528c30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-04-12  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * libs/gst/controller/gstcontroller.c: (gst_controller_unset),
+       (gst_controller_unset_all):
+         Free allocated GstTimedValues when freeing list nodes.
+         Should fix leaks 'make check-valgrind' complains about.
+
+       * win32/common/libgstcontroller.def:
+         Add gst_controller_unset_all.
+
 2006-04-11  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/libs/gstreamer-libs-sections.txt:
index 1bbfcbe..2fad312 100644 (file)
@@ -792,6 +792,7 @@ gst_controller_unset (GstController * self, gchar * property_name,
     /* check if a timed_value for the timestamp exists */
     if ((node = g_list_find_custom (prop->values, &timestamp,
                 gst_timed_value_find))) {
+      g_free (node->data);      /* free GstTimedValue */
       prop->values = g_list_delete_link (prop->values, node);
       res = TRUE;
     }
@@ -823,6 +824,8 @@ gst_controller_unset_all (GstController * self, gchar * property_name)
 
   g_mutex_lock (self->lock);
   if ((prop = gst_controller_find_controlled_property (self, property_name))) {
+    /* free GstTimedValue structures */
+    g_list_foreach (prop->values, (GFunc) g_free, NULL);
     g_list_free (prop->values);
     prop->values = NULL;
     res = TRUE;
index 571c940..ba6b805 100644 (file)
@@ -16,10 +16,11 @@ EXPORTS
        gst_controller_set_interpolation_mode
        gst_controller_sync_values
        gst_controller_unset
+       gst_controller_unset_all
        gst_object_control_properties
        gst_object_get_controller
        gst_object_get_value_array
        gst_object_get_value_arrays
        gst_object_set_controller
        gst_object_sync_values
-       gst_object_uncontrol_properties
\ No newline at end of file
+       gst_object_uncontrol_properties