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
This commit is contained in:
Pavel Holejsovsky 2012-03-31 19:12:48 +02:00 committed by Pavel Holejsovsky
parent 5374f24d38
commit d0b8813d14

View File

@ -819,7 +819,7 @@ _get_func(GIObjectInfo *info,
GIObjectInfo *parent_info; GIObjectInfo *parent_info;
gpointer func = NULL; gpointer func = NULL;
parent_info = info; parent_info = g_base_info_ref (info);
while (parent_info != NULL) while (parent_info != NULL)
{ {
parents = g_slist_prepend (parents, parent_info); parents = g_slist_prepend (parents, parent_info);
@ -828,7 +828,6 @@ _get_func(GIObjectInfo *info,
for (l = parents; l; l = l->next) for (l = parents; l; l = l->next)
{ {
GIObjectInfoRefFunction func;
parent_info = l->data; parent_info = l->data;
symbol = getter (parent_info); symbol = getter (parent_info);
if (symbol == NULL) if (symbol == NULL)