projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unref attribute should work better
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
lttv
/
attribute.c
diff --git
a/ltt/branches/poly/lttv/lttv/attribute.c
b/ltt/branches/poly/lttv/lttv/attribute.c
index a862cdf78ec094a9fe015b539d41c0221fdae09c..0eef75b80474263f1baa9e9fa0d6c5be2eeba13d 100644
(file)
--- a/
ltt/branches/poly/lttv/lttv/attribute.c
+++ b/
ltt/branches/poly/lttv/lttv/attribute.c
@@
-161,6
+161,10
@@
lttv_attribute_remove(LttvAttribute *self, unsigned i)
a = &g_array_index(self->attributes, Attribute, 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));
/* 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;
{
int i, nb;
@@
-249,7
+253,7
@@
void lttv_attribute_recursive_free(LttvAttribute *self)
}
}
g_object_unref(self);
}
}
g_object_unref(self);
-}
+}
*/
void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src)
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) {
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:
*value.v_int += a->value.dv_int;
break;
case LTTV_UINT:
@@
-522,11
+526,15
@@
attribute_instance_init (GTypeInstance *instance, gpointer g_class)
static void
attribute_finalize (LttvAttribute *self)
{
static void
attribute_finalize (LttvAttribute *self)
{
- g
_hash_table_destroy(self->names)
;
+ g
uint i
;
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "attribute_finalize()");
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "attribute_finalize()");
+
+ for(i=0;i<self->attributes->len;i++) {
+ lttv_attribute_remove(self, i);
+ }
+
+ g_hash_table_destroy(self->names);
g_array_free(self->attributes, TRUE);
g_array_free(self->attributes, TRUE);
- G_OBJECT_CLASS(g_type_class_peek_parent(
- g_type_class_peek(LTTV_ATTRIBUTE_TYPE)))->finalize(G_OBJECT(self));
}
}
This page took
0.032069 seconds
and
4
git commands to generate.