mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Delete trie during aggregator shutdown
This commit is contained in:
parent
6d5e75e46d
commit
f7161a875f
@ -109,7 +109,24 @@ remove_node(struct trie_node *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
delete_trie(struct trie_node *node)
|
||||||
{
|
{
|
||||||
|
assert(node != NULL);
|
||||||
|
|
||||||
|
if (is_leaf(node))
|
||||||
|
{
|
||||||
|
remove_node(node);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node->child[0])
|
||||||
|
delete_trie(node->child[0]);
|
||||||
|
|
||||||
|
if (node->child[1])
|
||||||
|
delete_trie(node->child[1]);
|
||||||
|
|
||||||
|
assert(is_leaf(node));
|
||||||
|
delete_trie(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1242,6 +1259,9 @@ aggregator_shutdown(struct proto *P)
|
|||||||
}
|
}
|
||||||
HASH_WALK_END;
|
HASH_WALK_END;
|
||||||
|
|
||||||
|
delete_trie(p->root);
|
||||||
|
p->root = NULL;
|
||||||
|
|
||||||
return PS_DOWN;
|
return PS_DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user