Hello Jason, you wrote > Is there some fundamental reason that the memory needs to be managed > by the parser? Why can't it be managed by the document?
I think this is merely a design issue: As the parser creates documents, it should also be responsible of deleting them. Solely for this reason the parser keeps a vector of all documents that it ever created. This list is scrubbed by calling resetDocumentPool() or once the parser is deleted. AFAIKS it would be no problem to add some method like 'giveDocument' to the parser that removes the latest Document from the list and makes the caller of this method responsible of deleting it. I'd suggest something like this: IDOM_Document* IDOMParser::giveDocument() { // We cannot enter here while a regular parse is in progress. if (fParseInProgress) ThrowXML(IOException, XMLExcepts::Gen_ParseInProgress); IDOM_Document* latestDoc = fDocument; delete fDocument; fDocument = 0; return latestDoc; } regards, Martin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]