[Goodies-commits] r5493 - xfbib/branches/gobject/src
David Gustafsson
tssj at xfce.org
Mon Sep 29 23:37:42 CEST 2008
Author: tssj
Date: 2008-09-29 21:37:42 +0000 (Mon, 29 Sep 2008)
New Revision: 5493
Modified:
xfbib/branches/gobject/src/xfbib-elements.c
xfbib/branches/gobject/src/xfbib-entry.c
Log:
Fixed a few memory leaks and a segmentation fault
Modified: xfbib/branches/gobject/src/xfbib-elements.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-elements.c 2008-09-29 20:29:21 UTC (rev 5492)
+++ xfbib/branches/gobject/src/xfbib-elements.c 2008-09-29 21:37:42 UTC (rev 5493)
@@ -292,5 +292,6 @@
g_return_if_fail(XFBIB_IS_ELEMENTS(elements));
g_list_foreach (elements->list, (GFunc) g_object_unref, NULL);
g_list_free (elements->list);
+ elements->list = NULL;
elements->n_entries = 0;
}
Modified: xfbib/branches/gobject/src/xfbib-entry.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-entry.c 2008-09-29 20:29:21 UTC (rev 5492)
+++ xfbib/branches/gobject/src/xfbib-entry.c 2008-09-29 21:37:42 UTC (rev 5493)
@@ -66,6 +66,11 @@
static void
xfbib_entry_finalize(GObject *obj)
{
+ XfbibEntry *entry = XFBIB_ENTRY(obj);
+ g_object_unref(entry->key);
+ g_object_unref(entry->bibtype);
+ g_list_foreach (entry->fields, (GFunc) g_object_unref, NULL);
+ g_list_free (entry->fields);
G_OBJECT_CLASS(xfbib_entry_parent_class)->finalize(obj);
}
More information about the Goodies-commits
mailing list