/* Removes @root and its children from the tree, freeing any memory allocated.  */
void g_node_destroy(GNode *root)
/* Removes @root and its children from the tree, freeing any memory allocated.  */
void g_node_destroy(GNode *root)
{
  g_return_if_fail (root != NULL);
  if (!G_NODE_IS_ROOT (root))
    g_node_unlink (root);
  g_nodes_free (root);
}