Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > destroy XercesDOMParser object caused memory violation

Reply
Thread Tools

destroy XercesDOMParser object caused memory violation

 
 
Meal
Guest
Posts: n/a
 
      07-20-2007
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

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      07-20-2007
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...
 
Reply With Quote
 
 
 
 
Joseph Kesselman
Guest
Posts: n/a
 
      07-20-2007
Meal wrote:
> "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...


--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
destroy primitive/object types but memory is not freed george972@mailinator.com C Programming 5 05-25-2009 10:44 PM
Destroy object from memory.. Object.const_destroy? Aaron Smith Ruby 3 07-05-2007 03:03 PM
When to destroy, when not to destroy Ook C++ 2 10-11-2005 02:11 AM
use delete to destroy primitive/object types but memory is not freed jimjim C Programming 28 04-13-2004 11:34 PM
Destroy COM object Jenny ASP .Net 1 07-21-2003 02:23 PM



Advertisments