[xsd-users] Tree FAQ memory management question

Iain Sharp isharp at atis.org
Wed May 23 06:33:51 EDT 2018


Hi,

In the "How do I create an empty Xerces-C++ DOM document?" section, a DOMDocument smart pointer is created with the line:
  xml::dom::auto_ptr<DOMDocument> doc (
    impl->createDocument (
      (ns.empty () ? 0 : xml::string (ns).c_str ()),
      xml::string ((prefix.empty () ? name : prefix + ':' + name)).c_str (),
      0));


I can't unpick how the smart pointer behaviour is interacting with the XERCESC memory management in this example. When the "doc" goes out of scope, will the doc->release() method be called to free any dependent resources before the doc object is destroyed?


Thanks

Iain



More information about the xsd-users mailing list