destroy XercesDOMParser object caused memory violation

Discussion in 'XML' started by Meal, Jul 20, 2007.

  1. Meal

    Meal Guest

    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
     
    Meal, Jul 20, 2007
    #1
    1. Advertising

  2. 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...
     
    Joe Kesselman, Jul 20, 2007
    #2
    1. Advertising

  3. 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
     
    Joseph Kesselman, Jul 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jenny

    Destroy COM object

    Jenny, Jul 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    537
    Alvin Bruney
    Jul 21, 2003
  2. jimjim
    Replies:
    28
    Views:
    890
    Michael Wojcik
    Apr 14, 2004
  3. Ook
    Replies:
    2
    Views:
    352
  4. Replies:
    5
    Views:
    563
    James Kuyper
    May 25, 2009
  5. Aaron Smith
    Replies:
    3
    Views:
    170
    Aaron Smith
    Jul 5, 2007
Loading...

Share This Page