Because, when you built the sample by itself, you probably built it for
debug. But the binary releases are production releases and use the
non-debug runtime. So, you now have two runtimes, one for the DLL and one
for the program. We allocate something for you in ours, and you delete it
yours and it blows up.

So you either have to use the production DLL C++ runtime in the sample
(even if you build for debug) or you have to rebuild our stuff in debug
mode as well.


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



Hao Ling <[EMAIL PROTECTED]> on 02/15/2000 07:28:14 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  problem with DOMPrint example



Hi,

When I use the release version of Xerces-C++ (Xerces-C_1_0_1-win32 or
the new xerces-c_1_1_0_d05-win32), the DOMPrint sample will abort with an
error message:
****************************************
Debug Assertion Failed!

program: ........\bin\DOMPrint.exe
File: dbgdel.cpp
Line: 47

Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
****************************************

This run-time error is disappear when I comment out the "delete"
instruction in the function "ostream& operator<<(ostream& target, const
DOMString&s)". That is the function is like

ostream& operator<<(ostream& target, const DOMString& s)
{
    char *p = s.transcode();
    target << p;
//    delete [] p;
    return target;
}

However, when I use the source files to build the Xerces and all of its
samples (using Xerces-C-src_1_0_1 and xerces-csrc_1_1_0_d05), the DOMPrint
sample runs very well without any change.

Can anyone tell me why this is happen, and how to run the sample without
commenting out the "delete" instruction. (I wonder there will be memory
leak when I omit the "delete" instruction.)

Thanks,
Hao Ling




Reply via email to