mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
repository: Squash memory leak in _get_func and fix up style
This commit is contained in:
parent
c99df8f34c
commit
c18e0be549
@ -756,28 +756,30 @@ _get_func(GIObjectInfo *info,
|
|||||||
const char* symbol;
|
const char* symbol;
|
||||||
GSList *parents = NULL, *l;
|
GSList *parents = NULL, *l;
|
||||||
GIObjectInfo *parent_info;
|
GIObjectInfo *parent_info;
|
||||||
|
gpointer func = NULL;
|
||||||
|
|
||||||
parent_info = info;
|
parent_info = info;
|
||||||
while (parent_info != NULL) {
|
while (parent_info != NULL)
|
||||||
parents = g_slist_prepend(parents, parent_info);
|
{
|
||||||
parent_info = g_object_info_get_parent(parent_info);
|
parents = g_slist_prepend (parents, parent_info);
|
||||||
}
|
parent_info = g_object_info_get_parent (parent_info);
|
||||||
|
|
||||||
for (l = parents; l; l = l->next) {
|
|
||||||
GIObjectInfoRefFunction func;
|
|
||||||
parent_info = l->data;
|
|
||||||
symbol = getter(parent_info);
|
|
||||||
if (symbol == NULL)
|
|
||||||
continue;
|
|
||||||
if (g_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (void**) &func)) {
|
|
||||||
g_slist_free(parents);
|
|
||||||
return func;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g_slist_free(parents);
|
for (l = parents; l; l = l->next)
|
||||||
return NULL;
|
{
|
||||||
|
GIObjectInfoRefFunction func;
|
||||||
|
parent_info = l->data;
|
||||||
|
symbol = getter (parent_info);
|
||||||
|
if (symbol == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
g_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func);
|
||||||
|
if (func)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slist_free_full (parents, (GDestroyNotify) g_base_info_unref);
|
||||||
|
return func;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user