Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
    static void TreeDestroyNodes (Node * _currentNode)
{
    if (_currentNode)
    {
        TreeDestroyNodes(_currentNode->m_left);
        TreeDestroyNodes(_currentNode->m_right);
        free(_currentNode);
    }
    return;
}

void TreeDestroy (Tree * _tree)
{
    if (!_tree)
    {
        return;
    }

    if (!_tree->m_root)
    {
        free(_tree);
        return;
    }

    TreeDestroyNodes(_tree->m_root);
    free(_tree);
}

hello. I'm getting a core dump before last line. would appreciate the help. Thank you.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.