gobjects referenced in attributes. No more recursive_free
[lttv.git] / ltt / branches / poly / lttv / lttv / attribute.c
index a862cdf78ec094a9fe015b539d41c0221fdae09c..db6fa6a6396ace93e02f2140db03022d1b719ac2 100644 (file)
@@ -161,6 +161,10 @@ lttv_attribute_remove(LttvAttribute *self, unsigned i)
 
   a = &g_array_index(self->attributes, Attribute, i);
 
+  /* If the element is a gobject, unreference it. */
+  if(a->type == LTTV_GOBJECT && a->value.dv_gobject != NULL)
+    g_object_unref(a->value.dv_gobject);
+  
   /* Remove the array element and its entry in the name index */
 
   g_hash_table_remove(self->names, GUINT_TO_POINTER(a->name));
@@ -234,7 +238,7 @@ lttv_attribute_find(LttvAttribute *self, LttvAttributeName name,
 }
 
 
-void lttv_attribute_recursive_free(LttvAttribute *self)
+/*void lttv_attribute_recursive_free(LttvAttribute *self)
 {
   int i, nb;
 
@@ -249,7 +253,7 @@ void lttv_attribute_recursive_free(LttvAttribute *self)
     }
   }
   g_object_unref(self);
-}
+}*/
 
 
 void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src)
@@ -272,7 +276,7 @@ void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src)
     else {
       g_assert(lttv_attribute_find(dest, a->name, a->type, &value));
       switch(a->type) {
-       case LTTV_INT:
+             case LTTV_INT:
           *value.v_int += a->value.dv_int;
           break;
         case LTTV_UINT:
This page took 0.023228 seconds and 4 git commands to generate.