Re: [xml] exception/segfault on xmlFreeDoc()



I know that. I don't tend to document a lot of stuff I do, although I
should. It's a real pain in the back when you got back to something
after several months and got no idea what you are doing there. But on
the other hand I haven't done that much API work so far, so missing
documentation does only hurt me.

But back to my "problem". I looked a bit into it, but MSVC++ debugger
does something fishy with my xmlNodePtrs.

I recognised, that xmlUnlinkNode() does not remove the reference to the
owner document. Neither for the root node not for the children. Also
does xmlDocSetRootElement() just set the doc of the root node to teh new
one.  And there lies my problem. All the childs of the unlinked node
still point to the old document that has been free'd already and so it
crashes when accessing members of the already free'd owner document.
Seems like I have to do in a different way.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]