destroy XercesDOMParser object caused memory violation

M

Meal

Hi,
Look at following simple code block:
---
XercesDOMParser *parser = 0;
try
{
XMLPlatformUtils::Initialize()
parser = new XercesDOMParser();
}
catch (...)
{
cout<< "Unknown error detected in parse()"<<endl;
}

delete parser;
XMLPlatformUtils::Terminate();
--
In my simple test application's main function, this block runs well.
But when I put this block in my business application's XML parsing
function, it fails with message
"memory corrupted...". And the error occurs only when processing the
delete statement.
Though this application is multi-threaded, I think the function is
executed in a single thread. -- would it be a problem if this function
is executed in multiple theads?
Without the block, the function runs well.
So, what could be the reason of the error?
I studied the default MemoryManager, and found nothing special.
I really have no idea
 
J

Joe Kesselman

I'd suggest contacting Xerces-C's own mailing list; that's where you'll
find the most expertise on the code's internals.

At a guess, I think you've answered your own question: If it hurts when
you do that...
 
J

Joseph Kesselman

Meal said:
"memory corrupted...". And the error occurs only when processing the
delete statement.

Actually, come to think of it, that sounds like some of your other code
is walking on the parser's data structures so they can't be deleted
cleanly...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top