transcode() gives you a newly allocated buffer, into which the contents of
the source string has been transcoded. You are responsible for cleaning it
up when you are done with it. This is the only way that this API can
reasonably work.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



[EMAIL PROTECTED] on 03/06/2000 08:39:53 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  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
[EMAIL PROTECTED]
Michael D. Crawford
GoingWare - Expert Software Development and Consulting
http://www.goingware.com
[EMAIL PROTECTED]

     Tilting at Windmills for a Better Tomorrow



Reply via email to