Hello,
I still have memory trouble using DOMNode::getTextContent with XERCES Ver. 2.3.0!
The following loop I created runs about 1400 times on my machine, and shortly after that it crashes! Does anybody see what causes the leak!?
It's not a leak; getTextContent() will allocate the returned buffer from the memory pool held by the DOMDocument. That memory will be released when you release the DOMDocument itself, but if you keep invoking it, your app will crash because of an uncaught "out of memory" exception.
The only suggestion I can give you is to avoid using getTextContent when you know that the element only contains a single text node, and use getNodeValue() on that child node.
Alberto
(I always ask for the same tag ("aufopn_1") to make it as easy as possible!)
Regards and thanks for the hint before Patrick
void get_sql_stat_from_xml_test() { DOMNodeList* sql_statements;
//Allocate XMLCh for Tag static XMLCh* pOutputEncoding[1];
pOutputEncoding[0] = XMLString::transcode("aufopn_1");
//1486 times ok, 1487 time it crashes!
for(int i=0; i<1486; i++){
sql_statements = get_xml_document()->getElementsByTagName(pOutputEncoding[0]);
char* pStr=XMLString::transcode(sql_statements->item(0)->getTextContent());
XMLString::release(&pStr);
}
//Release XMLString::release(&pOutputEncoding[0]); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
