At 22.51 01/08/2005 -0500, Rob Benton wrote:
Alberto Massari wrote:
You need to look at the sources of DOMWriterImpl, not at the documentation; look at src/xercesc/dom/impl/DOMWriterImpl.cpp and see how it uses the XMLFormatter to serialize XML.

OK this line is throwing me for a loop.  It's in DOMWriterImpl::writeNode()

fFormatter = new (fMemoryManager) XMLFormatter(fEncodingUsed
                                     ,fDocumentVersion
                                     ,destination
                                     ,XMLFormatter::NoEscapes
                                     ,XMLFormatter::UnRep_CharRef
                                     ,fMemoryManager);


I don't quite have my head around all the tricky things being done with the memory management. But where does that ever get deleted?

It is deleted through an helper class

        Janitor<XMLFormatter> janName(fFormatter);

When the janName object is destroyed (because it goes out of scope) the fFormatter pointer is deleted.

Alberto



Reply via email to