I don't think this is the cause of your corruption, but
there's no reason to call path.GetBuffer()/ReleaseBuffer(). By default,
the CString can be cast to a LPCTSTR (and should do so by default), so just call
parser->parse(path).
Adam Heinz
Senior Software Developer
Exstream Software
-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 1:38 PM
To: XML4C List ([EMAIL PROTECTED])
Subject: memory corruption when deleting the SAXParserI am developing in VC++6.0 with the latest service pack and using xerces-c_1_6_0D.dll. I'm having a problem with memory corruption when I try to delete the parser object. Any ideas? Thanks.try
{
XMLPlatformUtils::Initialize();
}
catch (const XMLException& er)
{
AfxMessageBox(CString(er.getMessage()));
return 0;
}
SAXParser* parser = new SAXParser;
try
{
parser->setValidationScheme(SAXParser::Val_Never);
CSaxHandlers handler("");
PaxarSAXErrorHandler error;
parser->setDocumentHandler(&handler);
parser->setErrorHandler(&error);
parser->parse(path.GetBuffer(0));
path.ReleaseBuffer(0);
delete parser;
}
catch(const SAXException& de)
{
delete parser;
XMLPlatformUtils::Terminate();
AfxMessageBox(CString(de.getMessage()));
return 0;
}
catch(const XMLException& e)
{
delete parser;
XMLPlatformUtils::Terminate();
AfxMessageBox(CString(e.getMessage()));
return 0;
}
XMLPlatformUtils::Terminate();