You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by fvela <fl...@gmail.com> on 2009/05/27 21:18:30 UTC

DOMDocumentImpl::getDOMConfig() memory leak

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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: DOMDocumentImpl::getDOMConfig() memory leak

Posted by fvela <fl...@gmail.com>.
Hi,

I am using xerces  3.0.1 

Flavia

Alberto Massari wrote:
> 
> Hi,
> which version of Xerces ar eyou using?
> 
> Alberto
> 
> fvela wrote:
>> 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? 
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
> 
> 
> 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: DOMDocumentImpl::getDOMConfig() memory leak

Posted by Alberto Massari <am...@datadirect.com>.
Hi,
which version of Xerces ar eyou using?

Alberto

fvela wrote:
> 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? 
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org