示例#1
0
PRIVATE void HTBTElement_free (HTBTElement*  element)
    /**********************************************************
    ** This void will HT_FREE the memory allocated for one element
    */
{
    if (element) {
        if (element->left != NULL)    HTBTElement_free(element->left);
	if (element->right != NULL)    HTBTElement_free(element->right);
	HT_FREE(element);
    }
}
示例#2
0
PUBLIC void HTBTree_free (HTBTree*  tree)
    /**************************************************************
    ** This void will HT_FREE the memory allocated for the whole tree
    */
{
    HTBTElement_free(tree->top);
    HT_FREE(tree);
}
示例#3
0
void HTBTElement_free( HTBTElement *element )
{
  if ( element )
  {
    if ( element->left )
      HTBTElement_free( &element->left );
    if ( element->right )
      HTBTElement_free( &element->right );
    if ( element == 0 )
    {
      return;
    }
    free( element );
    element = 0;
  }
  return;
}
示例#4
0
void HTBTree_free( HTBTree *tree )
{
  HTBTElement_free( (HTBTElement*)&tree->top );
  if ( tree )
  {
    free( tree );
    tree = 0;
  }
  return;
}