You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by cr...@goingware.com on 2000/03/07 05:39:53 UTC

memory leaks?

Hi,

I have a memory leak.  I'm not sure yet if it's in the library, or my faulty use of 
it.

I do something like this:

while ( not done ){
  DOM_Element el = (find the element)

  DOMString str = el.getAttribute( attributeName );

 char *foo = str.transcode();

 DoSomething( foo );
}

in my case I have the above loop 26 times, and the handle for str leaks 26 
times - this according to Onyx Technology's Spotlight for the MacOS, which 
is generally pretty reliable.

If you have Xerces running on the Mac, you can download a demo of spotlight 
at http://www.onyx-tech.com - on Windows you can try BoundsChecker.

it seems to me str's destructor should be called when the lower "}" is hit.

Mike Crawford
crawford@goingware.com
Michael D. Crawford
GoingWare - Expert Software Development and Consulting
http://www.goingware.com
crawford@goingware.com

     Tilting at Windmills for a Better Tomorrow