I have an application which parses Xinclude files. If i turn on the visual
studio built in memory leak detector and i get some errors due to this call. 

This call is being made in DOMDocumentImpl::normalizeDocument() which is
called in AbstractDOMParser::parse(const char* const systemId) if
fdoXInclude is enabled. 

the DOMDocumentImpl::getDOMConfig() is a const function. the problem is
comming from this shady call to new inside the const function:

if(!fDOMConfiguration)
        ((DOMDocumentImpl*)this)->fDOMConfiguration = new
((DOMDocumentImpl*)this) DOMConfigurationImpl(fMemoryManager);

any attempts to call delete on fDOMConfiguration in DOMDocumentImpl
destructor causes access violation. 

i have removed the creation of the fDOMConfiguration to the  DOMDocumentImpl
constructors and then deleted it in DOMDocumentImpl and the memory leak is
gone. 

My question is has anyone had this problem before?  is there any reason for
this call to new done in a const function instead of in the constructor? 

-- 
View this message in context: 
http://www.nabble.com/DOMDocumentImpl%3A%3AgetDOMConfig%28%29-memory-leak-tp23749046p23749046.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to