> 
> 
> Version number : 1.0.1
> Platform: NT4 + SP4
> Compiler: MSVC6
> 
> Sample file: Attached---Its basically a cut paste of DOMPrint sample
> 
> Problem: In function   ostream& operator<<(ostream& target, const DOMString& 
> s)
> 
> When delete is called on p it results in a Debug Assertion.
> In dbgheap.c and while evaluating the expression 
> _CrtlsValidHeapPointer(pUserData)
> 

>  if ((strcmp(nodeName.transcode(),"Hole") == 0) ||
>   (strcmp(toWrite.getParentNode().getNodeName().transcode(),"Hole") == 0) ||
>   (strcmp(nodeName.transcode(),"Assembly") == 0) ||
>   (strcmp(nodeName.transcode(),"Part") == 0)) {

In the file that you sent with the mail, I see definite memory leaks. 
However, I do not see any other problems. As Mike mentioned make sure
you are using the 'correct' runtime dll.

One way to ensure that everything matches up would be to download
the source archive and recompile the Xerces-C library on your machine.
That way the library and your application will use the same DLL's.

When you call 'transcode()', it allocates memory to store the trancoded
string and it is the callers responsibility to delete it. The code
in operator<< in DOMPrint and your sample is doing the right thing.

rahul


Reply via email to