You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/10/25 17:16:29 UTC

cvs commit: xml-xerces/c/samples/DOMCount DOMCount.cpp

tng         01/10/25 08:16:29

  Modified:    c/samples/DOMCount DOMCount.cpp
  Log:
  delete the parser before XMLPlatformUtils::Terminate.
  
  Revision  Changes    Path
  1.20      +14 -9     xml-xerces/c/samples/DOMCount/DOMCount.cpp
  
  Index: DOMCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMCount/DOMCount.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DOMCount.cpp	2001/10/19 19:02:42	1.19
  +++ DOMCount.cpp	2001/10/25 15:16:29	1.20
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: DOMCount.cpp,v 1.19 2001/10/19 19:02:42 tng Exp $
  + * $Id: DOMCount.cpp,v 1.20 2001/10/25 15:16:29 tng Exp $
    */
   
   // ---------------------------------------------------------------------------
  @@ -197,15 +197,15 @@
       }
   
       // Instantiate the DOM parser.
  -    DOMParser parser;
  -    parser.setValidationScheme(valScheme);
  -    parser.setDoNamespaces(doNamespaces);
  -    parser.setDoSchema(doSchema);
  -    parser.setValidationSchemaFullChecking(schemaFullChecking);
  +    DOMParser* parser = new DOMParser;
  +    parser->setValidationScheme(valScheme);
  +    parser->setDoNamespaces(doNamespaces);
  +    parser->setDoSchema(doSchema);
  +    parser->setValidationSchemaFullChecking(schemaFullChecking);
   
       // And create our error handler and install it
       DOMCountErrorHandler errorHandler;
  -    parser.setErrorHandler(&errorHandler);
  +    parser->setErrorHandler(&errorHandler);
   
       //
       //  Get the starting time and kick off the parse of the indicated
  @@ -250,7 +250,7 @@
           try
           {
               const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
  -            parser.parse(xmlFile);
  +            parser->parse(xmlFile);
               const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
               duration = endMillis - startMillis;
           }
  @@ -289,7 +289,7 @@
           }
            else
           {
  -            DOM_Document doc = parser.getDocument();
  +            DOM_Document doc = parser->getDocument();
               unsigned int elementCount = doc.getElementsByTagName("*").getLength();
   
               // Print out the stats that we collected and time taken.
  @@ -300,6 +300,11 @@
   
       if (doList)
           fin.close();
  +
  +    //
  +    //  Delete the parser itself.  Must be done prior to calling Terminate, below.
  +    //
  +    delete parser;
   
       // And call the termination method
       XMLPlatformUtils::Terminate();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org