mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 13:06:14 +01:00
registrybackend: another cleanup creating a registry cache item
This commit is contained in:
parent
c73e9fc36a
commit
63b0f1087d
@ -603,6 +603,7 @@ registry_cache_get_node_for_key_recursive (GNode *node,
|
|||||||
return child;
|
return child;
|
||||||
|
|
||||||
trace ("get node for key recursive: next: %s.\n", c + 1);
|
trace ("get node for key recursive: next: %s.\n", c + 1);
|
||||||
|
|
||||||
return registry_cache_get_node_for_key_recursive (child, c + 1,
|
return registry_cache_get_node_for_key_recursive (child, c + 1,
|
||||||
create_if_not_found,
|
create_if_not_found,
|
||||||
n_parent_watches);
|
n_parent_watches);
|
||||||
@ -632,15 +633,13 @@ registry_cache_get_node_for_key (GNode *root,
|
|||||||
child = registry_cache_find_immediate_child (root, component);
|
child = registry_cache_find_immediate_child (root, component);
|
||||||
if (child == NULL && create_if_not_found)
|
if (child == NULL && create_if_not_found)
|
||||||
{
|
{
|
||||||
|
RegistryValue null_value = { REG_NONE, {0} };
|
||||||
|
|
||||||
/* Reference count is set to 0, tree should be referenced by the caller */
|
/* Reference count is set to 0, tree should be referenced by the caller */
|
||||||
RegistryCacheItem *item = g_slice_new (RegistryCacheItem);
|
child = registry_cache_add_item (root, component,
|
||||||
item->value.type = REG_NONE;
|
null_value, 0);
|
||||||
item->value.ptr = NULL;
|
|
||||||
item->name = g_strdup (component);
|
trace ("get_node_for_key: New node for component '%s'\n", component);
|
||||||
item->ref_count = 0;
|
|
||||||
trace ("get_node_for_key: New node for component '%s'\n", item->name);
|
|
||||||
child = g_node_new (item);
|
|
||||||
g_node_append (root, child);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user