Still trying to track down the problem here...

I created a simple mfc win32 console program and inserted the same code I
was getting the memory error in my other program into the main function, and
it failed at the same delete as the other program I was working on.  So I
think it's got to be something with my project settings or the project
settings for the xml dll.  The error is saying the pointer is not in the
normal memory block?  Whatever that means...  This is what it says when I
try to debug into the microsoft code:
/*
         * 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));

What is the local heap?  I thought it was all the same??

One more note, I download and installed the trial PurifyPlus program by
Rational, and the delete command works fine when it's run under that
analyzer.  Weird!

Any ideas??  Thanks.

-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 19, 2004 10:05 AM
To: '[EMAIL PROTECTED]'
Subject: RE: memory corruption when deleting the SAXParser


Well, I would assume since the debugger returns from constructing the new
object, it would not be still running in a thread when deleting the object
(since the delete command is executed directly after the new object is
created - just for debugging purposes). 

-----Original Message-----
From: Peter Guyatt [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 19, 2004 9:48 AM
To: [EMAIL PROTECTED]
Subject: RE: memory corruption when deleting the SAXParser


Hi There

        I am wondering if there is still a thread in the Sax Parser running
when you call the destructor for the parser.

This would have unwanted results!

Pete



-----Original Message-----
From: Nathan Smith [mailto:[EMAIL PROTECTED]
Sent: 19 March 2004 13:41
To: '[EMAIL PROTECTED]'
Subject: RE: memory corruption when deleting the SAXParser


Well just to rule that out, I commented everything out after the Initialize
statement except for the new SAXParser statement and the corresponding
delete, and it still gave me the same error.

-----Original Message-----
From: Alberto Massari [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: memory corruption when deleting the SAXParser


Hi Nathan,
what is the code for your CSaxHandlers class? Maybe the corruption is there

Alberto

At 13.38 18/03/2004 -0500, Nathan Smith wrote:
>
>I 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();



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

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


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

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

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

Reply via email to