[rhythmbox] metadata: use GSlice to allocate GValues (bug #587329)



commit b89bc041494ba819358cb608dd6132818776c98a
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Jun 30 09:28:58 2009 +1000

    metadata: use GSlice to allocate GValues (bug #587329)
    
    Since commit 606ab6746597b8c1ca5d35e52db345bc46a67e8b they've been
    freed as if they were allocated this way.  This fixes various allocation
    related complaints from the metadata helper process.

 metadata/rb-metadata-gst.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/metadata/rb-metadata-gst.c b/metadata/rb-metadata-gst.c
index 4936ade..a5a6d43 100644
--- a/metadata/rb-metadata-gst.c
+++ b/metadata/rb-metadata-gst.c
@@ -359,7 +359,7 @@ rb_metadata_gst_load_tag (const GstTagList *list, const gchar *tag, RBMetaData *
 
 	type = rb_metadata_get_field_type (field);
 	val = gst_tag_list_get_value_index (list, tag, 0);
-	newval = g_new0 (GValue, 1);
+	newval = g_slice_new0 (GValue);
 	g_value_init (newval, type);
 	if (!g_value_transform (val, newval)) {
 
@@ -811,7 +811,7 @@ rb_metadata_load (RBMetaData *md,
 
 			if (gst_element_query_duration (md->priv->sink, &format, &length)) {
 				g_assert (format == GST_FORMAT_TIME);
-				newval = g_new0 (GValue, 1);
+				newval = g_slice_new0 (GValue);
 
 				rb_debug ("duration query succeeded");
 
@@ -1119,7 +1119,7 @@ rb_metadata_set (RBMetaData *md, RBMetaDataField field,
 	type = rb_metadata_get_field_type (field);
 	g_return_val_if_fail (type == G_VALUE_TYPE (val), FALSE);
 
-	newval = g_new0 (GValue, 1);
+	newval = g_slice_new0 (GValue);
 	g_value_init (newval, type);
 	g_value_copy (val, newval);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]