Re: [libxml++] libxml++ crashing



panoply att net wrote:

> I've got a VC++ project that depends on libxml++, and crashes when a vector returned from libxml++ goes out of scope (specifically, I'm referring to the find() routine).  I also noticed that the Element::get_children() call always seems to return a higher number of children, for that context node, than the document actually has.  I'm a little suspicious that the faulty "number of children" reporting is responsible for the destruction of non-existent pointers.  But I don't know.

get_children() will include whitespace-only text nodes, Processing
Instructions, comments, entity declarations and other types of node,
not just elements.  This is almost certainly why you're seeing a
higher number than you expect.

As for the vector, are you taking a reference to it, or a pointer, and
holding onto that reference longer than you should?

jon


-- 
"The ability to quote is a serviceable substitute for wit."
	- W. Sommerset Maugham




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