Move comments
parent
23f2148948
commit
c8e292bd0a
|
@ -68,11 +68,11 @@ node_print ( node_t *root, int nesting )
|
||||||
printf ( "%*c%p\n", nesting, ' ', root );
|
printf ( "%*c%p\n", nesting, ' ', root );
|
||||||
}
|
}
|
||||||
|
|
||||||
// The discard should have zero children here. If not -> MEMORY LEAK
|
|
||||||
static void
|
static void
|
||||||
node_finalize ( node_t *discard )
|
node_finalize ( node_t *discard )
|
||||||
{
|
{ // The discard should have zero children here. If not -> MEMORY LEAK
|
||||||
// Free the data and the children lists.
|
// Free the data and the children list.
|
||||||
free(discard->data);
|
free(discard->data);
|
||||||
free(discard->children);
|
free(discard->children);
|
||||||
free(discard);
|
free(discard);
|
||||||
|
@ -87,7 +87,7 @@ destroy_subtree ( node_t *discard )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// This will not run if n_children is zero
|
// This will not run if n_children is zero
|
||||||
// If non-zero, destroy all child recursivly
|
// If non-zero, destroy all children recursivly
|
||||||
while (discard->n_children--)
|
while (discard->n_children--)
|
||||||
destroy_subtree(discard->children[discard->n_children]);
|
destroy_subtree(discard->children[discard->n_children]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue