avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer DefaultXMLizer.java
Date Mon, 13 Oct 2003 11:09:39 GMT
cziegeler    2003/10/13 04:09:39

  Modified:    xmlutil/src/java/org/apache/excalibur/xmlizer
                        DefaultXMLizer.java
  Log:
  Fixing possible memory leak
  
  Revision  Changes    Path
  1.10      +7 -4      avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer/DefaultXMLizer.java
  
  Index: DefaultXMLizer.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer/DefaultXMLizer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultXMLizer.java	27 Feb 2003 09:24:48 -0000	1.9
  +++ DefaultXMLizer.java	13 Oct 2003 11:09:39 -0000	1.10
  @@ -152,19 +152,22 @@
               parserRole = SAXParser.ROLE;
           }
   
  +        SAXParser parser = null;
           try
           {
  -            final SAXParser parser = (SAXParser) m_serviceManager.lookup( parserRole );
  +            parser = (SAXParser) m_serviceManager.lookup( parserRole );
   
               final InputSource inputSource = new InputSource( stream );
               inputSource.setSystemId( systemID );
               parser.parse( inputSource, handler, null );
  -
  -            m_serviceManager.release(parser);
           }
           catch ( ServiceException e )
           {
               throw new SAXException( "Cannot parse content of type " + mimeType, e );
  +        }
  +        finally 
  +        {
  +            m_serviceManager.release(parser);        
           }
       }
   }
  
  
  

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


Mime
View raw message