xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lyle Coder" <x_co...@hotmail.com>
Subject deleting a XalanNode
Date Fri, 05 Jan 2001 23:52:53 GMT
Hi,
I have a function called xalan_free which walks the XalanDom in post order
freeing at the end of the walk like this:

void xalan_free(XalanNode *node)
{
    if(node->hasChildren())
        xalan_free(node->getFirstChild());

    if (node->getNextSibling())
        xalan_free(node->getNextSibling());

    if (node->getNodeType() != XalanNode::DOCUMENT_NODE)
        node->getParentNode()->removeChild(node);

    delete node;
}

problem is I get a seg fault at the delete... can some one tell me what I'm
doing wrong?

Thanks
Lyle

Mime
View raw message