Motti Shneor wrote:
Hello again.
Several xerces API calls (e.g.
xercesc::DOMElement*->getElementsByTagName()) return
xercesc::DOMNodeList* "live" objects.
Do I need to delete/release these objects when I'm done using them? How?
Other calls (e.g. xercesc::DOMNode *->getAttributes()), return
xercesc::DOMNamedNodeMap*.
Again --- do I need to release them when I'm done with them?
Is there a general rule for releasing API internal/instantiated objects?
I suggest you read the Xerces-C documentation for more details on how
memory is managed within the DOM implementation:
http://xml.apache.org/xerces-c/
In particular, your question is answered here:
http://xml.apache.org/xerces-c/ApacheDOMC++BindingL2.html
" C++ Memory Management:
1. A member method "release()" is added for releasing any "orphaned"
resources that were created through createXXXX factory method.
2. Memory for any returned object e.g.
* DOMNodeList* getChildNodes()
* DOMNodeList* getElementsByTagName()
* NamedNodeMap* getEntities()
* ... etc.
* are owned by implementation
"
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]