Title: Deleting char* returned from DOMString.transcode() in VC++ 6.0
         To Dave and Jesse;
Just another caviot to this ongoing sogga -
 
the comment inside of dbgheap.c where the Assertion fails says the following:
 
        /*
         * If this ASSERT fails, a bad pointer has been passed in. It may be
         * totally bogus, or it may have been allocated from another heap.
         * The pointer MUST come from the 'local' heap.
         */       
        _ASSERTE(_CrtIsValidHeapPointer(pUserData));
Like I said; this maybe just a Microsoft quark.
 
Gary
 
-----Original Message-----
From: Dave Connet [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 1:05 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Deleting char* returned from DOMString.transcode() in VC++ 6.0

In addition to Jesse's reply to this message, you should use:
    delete [] Name;
 
Dave Connet

-----Original Message-----
From: Gary Marsh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 12:29 PM
To: [EMAIL PROTECTED]
Subject: RE: Deleting char* returned from DOMString.transcode() in VC++ 6.0

Jesse;
 
Thanks for the tip.  I am linking to the xerces_c_1D.lib and I have the xerces_c_1_4D.dll in my path.  Upon recompile/link of my
program I got the following error message during the run:
 
    Debug Assertion Failed!
 
    Program: D:\MyDevArea\XGateWayTest\Debug\XGateWayTest.exe
    File: dbgheap.c
    Line: 1044
   
    Expression: _CrtIsValidHeapPointer(pUserData)
                        .
                        .
                        .
 
the code that generated this is the following:
 
       
        Name = (char*)item.getNodeName().transcode();
 
        nodeName.assign( Name );
 
        delete Name;
 
//        DOMString::transcodeDelete(Name);
 

The moment the delete Name; line is executed the above error is generated.
 
If I comment the delete Name; line and uncomment the DOMString::transcodeDelete(Name); line
which I added locally to the Xerces library, then it runs fine.
 
Gary
 
-----Original Message-----
From: Jesse Pelton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 11:50 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Deleting char* returned from DOMString.transcode() in VC++ 6.0

Reply via email to