changeset 3528:9cc39a38fdfe trunk

Oops, static field values were not being freed, fixed.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 14 Sep 2007 23:55:45 +0300
parents fb5bc40d0b86
children 7e8c4aadfc32
files src/audacious/tuple.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/tuple.c	Fri Sep 14 08:07:56 2007 +0300
+++ b/src/audacious/tuple.c	Fri Sep 14 23:55:45 2007 +0300
@@ -94,9 +94,21 @@
 tuple_destroy(gpointer data)
 {
     Tuple *tuple = (Tuple *) data;
+    gint i;
 
     TUPLE_LOCK_WRITE();
     mowgli_dictionary_destroy(tuple->dict, tuple_value_destroy, NULL);
+
+    for (i = 0; i < FIELD_LAST; i++)
+        if (tuple->values[i]) {
+            TupleValue *value = tuple->values[i];
+            
+            if (value->type == TUPLE_STRING)
+                g_free(value->value.string);
+            
+            mowgli_heap_free(tuple_value_heap, value);
+        }
+    
     mowgli_heap_free(tuple_heap, tuple);
     TUPLE_UNLOCK_WRITE();
 }