DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20764>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20764

after XMLPlatformUtils::Terminate() XercesDOMParser destructor throws

           Summary: after XMLPlatformUtils::Terminate() XercesDOMParser
                    destructor throws
           Product: Xerces-C++
           Version: 2.3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I’m not sure if it’s allowed to call XMLPlatformUtils::Terminate() before the
XercesDOMParser::~XercesDOMParser(). Description says call
XMLPlatformUtils::Terminate() is optional. 

If XMLPlatformUtils::Terminate() is called, it deletes fgMemoryManager. Then
from XercesDOMParser destructor DOMDeepNodeListPool<TVal>::removeAll() gets
called and fMemoryManager there points to deleted memory. File
xercesc\dom\impl\DOMDeepNodeListPool.c, line 
fMemoryManager->deallocate(curElem->fKey2);

The code:

f()
{
    XMLPlatformUtils::Initialize();

    XercesDOMParser parser;

    parser.setDoSchema( true );
    parser.setDoNamespaces( true );
    parser.useScanner( XMLUni::fgSGXMLScanner );

    parser.parse( xml_file );

    xrc::XMLPlatformUtils::Terminate();
} // exception thrown at this point


tested on Win2000 SP2, MSVC++6.0 SP 4, Pentium 4 1.9GH, RAM 512M

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

Reply via email to