From d0b8813d1480d2c99aa1d242edb545d747966688 Mon Sep 17 00:00:00 2001 From: Pavel Holejsovsky Date: Sat, 31 Mar 2012 19:12:48 +0200 Subject: [PATCH] Avoid _get_func() consuming reference from input info Fix of leak in 4c9424e18d71237f438a99bc5f2d45ae7de60b78 was a bit overaggressive, stealing also one reference from input 'info' argument. Also fixes another bug in that commit - local 'func' shadowing the return value, causing that function always returned NULL even when some result was actually found. https://bugzilla.gnome.org/show_bug.cgi?id=673282 --- giobjectinfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/giobjectinfo.c b/giobjectinfo.c index 3b8f64bb8..7ba2a93b8 100644 --- a/giobjectinfo.c +++ b/giobjectinfo.c @@ -819,7 +819,7 @@ _get_func(GIObjectInfo *info, GIObjectInfo *parent_info; gpointer func = NULL; - parent_info = info; + parent_info = g_base_info_ref (info); while (parent_info != NULL) { parents = g_slist_prepend (parents, parent_info); @@ -828,7 +828,6 @@ _get_func(GIObjectInfo *info, for (l = parents; l; l = l->next) { - GIObjectInfoRefFunction func; parent_info = l->data; symbol = getter (parent_info); if (symbol == NULL)