My programs on solaris use only 1 heap (I've done NT c++ before & the
general rule I've used in WIN32 programming is that memory allocated by a
method/function within a DLL must be free'd by a method/function from the
same dll so that the allocating heap is used).
You might want to fire up BoundsChecker or Purify to see if you might be
having a double delete problem (one reason for setting pointers to 0 after
delete) or some other similar problem. good luck.

> -----Original Message-----
> From: Mitchell, Raymond [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 1:51 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      Problem deleting transcoded data
> 
> The project I am working on makes use of Xerces-C on Win2000, Solaris, and
> Mac.  I have run into a problem on Windows and Solaris.  When I attempt to
> delete the memory allocated during a transcode, I get an illegal memory
> access.
> 
> On Win2000, my project makes use of the Multithreaded runtime library.
> This
> cannot be changed, so I linked Xerces-C to the Multithreaded runtime
> library
> as well (instead of the Multithreaded DLL runtime library which is the
> default).  This prevented the mixing of runtimes, but the error persisted.
> After digging throught the MSDN, I discovered that a DLL that links to the
> Multithreaded runtime library will allocate its own heap, independent of
> the
> heap allocated by applications that use the DLL.  This happens even though
> both the application and DLL link to the Multithreaded runtime library.
> Since Xerces-C is distributed as a DLL, the pointer returned from
> Transcode() references memory allocated in the DLL's heap.  An error
> occurs
> when an attempt is made to delete this pointer from an application using
> the
> DLL.  
> 
> So to use Xerces-C on Windows, one has basically has two options:  1) To
> convert Xerces-C to a statically linked library, so that the heap used by
> Xerces-C is the same as that of the application, or 2) To have your
> application use the Multithreaded DLL runtime library so that once again
> the
> heaps are the same.
> 
> I have received the same problem on UNIX and am currently in the process
> of
> converting Xerces-C from a shared to static library.
> 
> Has anyone else run into these problems?  Do these problems exist on Mac
> as
> well (I haven't implemented the code there yet)?  Would a possible
> solution
> to all this be to provide a method on DOMString that takes a pointer to
> the
> memory returned by Transcode() and deletes it for you?
> 
> Thanks for any help,
> Ray
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


****************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***********************************************************************


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

Reply via email to