Have you tried putting the DOM_Document into an inner scope?  I believe the
Xerces shutdown code will not free things if there are reference counts.
In particular, I think DOMStringHandles are not freed.  Try this:

int main (void)
{
     HMODULE hDllHandle = NULL;
     DOM_DOMImplementation          impl;

     hDllHandle = LoadLibrary("myxml.dll"); // this one causes a leak to be
reported
//         hDllHandle = LoadLibrary("mynonxml.dll"); // this one is ok

      XMLPlatformUtils::Initialize();

     {
          DOM_Document doc = impl.createDocument(
                                          0,
                                          "Input",
                                          DOM_DocumentType());
     }

     XMLPlatformUtils::Terminate();

     FreeLibrary(hDllHandle);

     return 0;
}

All Xerces objects should be destroyed before you attempt th call
XMLPlatformUtils::Terminate().

Dave



                                                                                       
                           
                    Wyles Eric -                                                       
                           
                    ewyles               To:     "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>    
                    <Eric.Wyles@a        cc:     (bcc: David N Bertoni/CAM/Lotus)      
                           
                    cxiom.com>           Subject:     RE: Memory Leaks (code sample 
included)                     
                                                                                       
                           
                    06/07/2001                                                         
                           
                    02:05 PM                                                           
                           
                    Please                                                             
                           
                    respond to                                                         
                           
                    xerces-c-dev                                                       
                           
                                                                                       
                           
                                                                                       
                           



In that case though, why would I not see this if I run my application
without loading the dll? Or even if I load a different dll that isn't using
the xerces libraries?

I'm not quite sure I understand what is going on here.

Thanks,
Eric


-----Original Message-----
From: Dean Roddey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 12:26 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Memory Leaks (code sample included)


Xerces faults in some static data. These can show up as memory leaks to
some
tools, but they are really just static stuff that is faulted in on first
use, but never released until the program ends. If you really want to test
it, load the DLL, do an initital dummy parse, then take a memory snap shot
and check again just before you call terminate. The first parse will cause
all of the lazy faulting in, so if you take a snapshot after that, anything
that shows up in the exit snap shot is a lot more likely to be a legitimate
leak.

--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]



-----Original Message-----
From: Wyles Eric - ewyles [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 9:47 AM
To: '[EMAIL PROTECTED]'
Subject: Memory Leaks (code sample included)


Hi,

I'm having a problem with memory leaks under xerces c++ 1.4.0 on Windows NT
using Visual C++ 6.0. I have two different modules using the xerces api.

1) A very small test application that I have written (code below)
2) A dll that is called by this test application, but will eventually be
called by other users (let's call this one 'myxml.dll')

Both of these are linked against the xerces libraries.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to