We need to store the new GList. Else, this causes problems if we remove the first...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Mon, 20 Oct 2003 08:22:19 +0000 (08:22 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Mon, 20 Oct 2003 08:22:19 +0000 (08:22 +0000)
Original commit message from CVS:
We need to store the new GList. Else, this causes problems if we remove the first entry from the list (unreferenced pointer). Also, we need to destroy the unused entry afterwards (memleak).

gst/gstprops.c

index 600d776..49f922c 100644 (file)
@@ -969,7 +969,8 @@ gst_props_remove_entry_by_id (GstProps *props, GQuark propid)
 
     if (lentry->propid == propid) {
       found = TRUE;
-      g_list_delete_link (props->properties, current);
+      props->properties = g_list_delete_link (props->properties, current);
+      gst_props_entry_destroy (lentry);
     }
     else if (GST_PROPS_ENTRY_IS_VARIABLE (lentry)) {
       GST_PROPS_FLAG_UNSET (props, GST_PROPS_FIXED);