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 "Christy, Rich" <Ri...@citadelgroup.com> on 2001/11/01 20:44:21 UTC

RE: delete[] problems with transcode

OK, not removing the lists did stop the core dump.  When I ran Purify no
longer saw any references from my application creating lists as leaks like I
did in an earlier release.  However, I do see several references to possible
leaks in IDeepNodeListPool within calls to IDOM_NodeList
getElementsByTagName().  Any ideas?

Thanks

Rich

-----Original Message-----
From: Alberto Massari [mailto:alby@exceloncorp.com]
Sent: Wednesday, October 31, 2001 10:29 AM
To: xerces-c-dev@xml.apache.org
Subject: Re: delete[] problems with transcode


At 08:08 AM 10/31/2001 -0800, you wrote:

>"Christy, Rich" wrote:
>
> > Actually purify was complaining of a memory leak with the list until I
> > deleted it.
>
>There may be an IDOM leak bug ....  How does the caller retrieve parameter
>"const IDOM_Element *parentElement" ?  If it is from the parser, then
memory
>should be released when the parser is destroyed.   If it is from an IDOM
>document that you are building, then delete the document itself should also
>release all the memory.   If leak still persists after the parser / 
>document is
>destroyed, then please open a bugzilla bug for further investigation.  But
no
>matter what, please remove "delete list;" which will corrupt the heap and
core
>dump.

Tinny, I think that the IDOM_NodeList should be deleted; in fact, in this 
case, IDOM it's probably not returning an internal list (like when you call 
getChildren()), but allocating a brand new list just to hold the pointers 
of the IDOM_Node objects that match the specified node name

IDOM_NodeList *list =
parentElement->getElementsByTagName(transcodedElement);

Alberto


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

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


Re: delete[] problems with transcode

Posted by Tinny Ng <tn...@ca.ibm.com>.
"Christy, Rich" wrote:

> However, I do see several references to possible
> leaks in IDeepNodeListPool within calls to IDOM_NodeList
> getElementsByTagName().  Any ideas?
>
> Thanks
>
> Rich

I just looked into the code again, I think there is a small leak on the pool
instance.  Anyway, I just checked in the fix, and here is the diff if you want
to test out the fix:

cvs diff IDDocumentImpl.cpp (in directory D:\cvswork\xml-xerces\c\src\idom)
Index: IDDocumentImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/idom/IDDocumentImpl.cpp,v
retrieving revision 1.11
diff -r1.11 IDDocumentImpl.cpp
952c952
<         fNodeListPool = new IDDeepNodeListPool<IDDeepNodeListImpl>(109,
false);
---
>         fNodeListPool = new (this) IDDeepNodeListPool<IDDeepNodeListImpl>(109,
false);

Tinny


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