Hi all,

I am using Visual C++ v6.0 sp5 on Windows XP sp1
and xerces-c++ version 2.3.0.

I try to execute the following example (compiling as a single threaded
run-time library, and linking with xerces binary either downloaded (or
recompiled as
single-threaded library : pb is the same)) :

...
int main(int argc, char* argv[]) {
    xercesc::XMLPlatformUtils::Initialize();

    char szHW[15] = "Hello World";
    printf("%s!\n", szHW);

    XMLCh* sLocalName = xercesc::XMLString::transcode(szHW);
    // copy (replicate)
    XMLCh* sLocalNameCopy = xercesc::XMLString::replicate(sLocalName);

    // release sLocalName
    printf("release sLocalName\n");
    xercesc::XMLString::release(&sLocalName);

    // release sLocalNameCopy
    printf("release sLocalNameCopy\n");
    // [1]
    xercesc::XMLString::release(&sLocalNameCopy);
    // [2]
//     delete [] sLocalNameCopy;
//     sLocalNameCopy = NULL;

    printf("The World is Beautiful !\n");

    xercesc::XMLPlatformUtils::Terminate();
    return 0;
}


it works when application is using the debug build.

output :

Hello World!
release sLocalName
release sLocalNameCopy
The World is Beautiful !


But unfortunately, with a release build, an error occurs : The world is
never beautiful :(

output :

Hello World!
release sLocalName
release sLocalNameCopy

HEAP[xercesctest.exe]: Invalid Address specified to RtlFreeHeap(
00330000,
00350F80 )



XMLString::release(&(XMLString::replicate(...))) doesn't not seem to
work in release mode.

(if i try  :
delete [] sLocalNameCopy;
sLocalNameCopy = NULL;
it works fine : but not with debug version)

is there an error in my program or a bug in xerces ?

This problem disappears when I compile my app as multi-threaded, but I
want it single threaded...

Thanks & Regards

Emmanuel T.


____________________________________________________________________
- http://www.WebMailSPro.com - >> 
Cr�er votre WebBased email pour avec votre propre nom de domaine 


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

Reply via email to