http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1685 *** shadow/1685 Wed May 9 11:35:38 2001 --- shadow/1685.tmp.12484 Wed May 9 11:35:38 2001 *************** *** 0 **** --- 1,92 ---- + +============================================================================+ + | memory leak after parsing document with validation error | + +----------------------------------------------------------------------------+ + | Bug #: 1685 Product: Xerces-C | + | Status: NEW Version: 1.4 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Medium Component: Validating Parser (DTD) | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + when i parse an XML document (with validation on) which contains an error, + there is a memory leak when my application exits. this memory leak only occurs + when compiling with the VC++6.0 Debug Multithreaded DLL - if i use the Debug + Singlethreaded runtime there is no memory leak. i have been using the + distribution library and DLL. below are samples of the code, XML and DTD. + + + CODE: + ----- + + #include <util/PlatformUtils.hpp> + #include <parsers/DOMParser.hpp> + #include <sax/HandlerBase.hpp> + #include <crtdbg.h> + + + // PARSE AN XML FILE + void main(int argc, char *argv[]) { + if(argc < 2) return; + + // INITIALISE XERCES + XMLPlatformUtils::Initialize(); + + // CONSTRUCT OBJECTS + DOMParser *parser = new DOMParser(); + HandlerBase errorHandler; + parser->setErrorHandler(&errorHandler); + parser->setValidationScheme(DOMParser::Val_Always); + + // PARSE + parser->parse(argv[1]); + delete parser; + + // TERMINATE XERCES + XMLPlatformUtils::Terminate(); + _CrtDumpMemoryLeaks(); + } + + + XML: + ---- + + <?xml version="1.0" encoding="iso-8859-1"?> + <!DOCTYPE test PUBLIC "-//Static 2358//DTD test//EN" "test.dtd"> + + + <test name="config" max_services="10" max_sockets="10" client_port="2358" + socket_buffer="65536"> + + <service filename="financetv.xst"> + + </test> + + + DTD: + ---- + + <?xml version="1.0" encoding="ISO-8859-1"?> + + + <!ELEMENT test ANY> + <!ATTLIST test + name CDATA #REQUIRED + max_services CDATA #IMPLIED + max_sockets CDATA #IMPLIED + max_events CDATA #IMPLIED + client_port CDATA #IMPLIED + socket_buffer CDATA #IMPLIED + > + + + <!ELEMENT service EMPTY> + <!ATTLIST service + filename CDATA #REQUIRED + active (true | false) "true" + > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
