You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2003/04/21 23:07:39 UTC

cvs commit: xml-xerces/c/src/xercesc/sax InputSource.cpp SAXParseException.cpp

knoaman     2003/04/21 14:07:38

  Modified:    c/src/xercesc/internal XMLReader.cpp
               c/src/xercesc/sax InputSource.cpp SAXParseException.cpp
  Log:
  Use XMLString::release to prepare for configurable memory manager.
  
  Revision  Changes    Path
  1.13      +15 -20    xml-xerces/c/src/xercesc/internal/XMLReader.cpp
  
  Index: XMLReader.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLReader.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XMLReader.cpp	28 Jan 2003 18:32:53 -0000	1.12
  +++ XMLReader.cpp	21 Apr 2003 21:07:37 -0000	1.13
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -61,22 +61,17 @@
   // ---------------------------------------------------------------------------
   //  Includes
   // ---------------------------------------------------------------------------
  +#include <xercesc/internal/XMLReader.hpp>
   #include <xercesc/util/BitOps.hpp>
   #include <xercesc/util/BinInputStream.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
   #include <xercesc/util/RuntimeException.hpp>
   #include <xercesc/util/TranscodingException.hpp>
   #include <xercesc/util/TransService.hpp>
  -#include <xercesc/util/UTFDataFormatException.hpp>
   #include <xercesc/util/XMLEBCDICTranscoder.hpp>
   #include <xercesc/util/XMLString.hpp>
  -#include <xercesc/util/XMLUni.hpp>
  -#include <xercesc/sax/InputSource.hpp>
   #include <xercesc/framework/XMLBuffer.hpp>
  -#include <xercesc/internal/CharTypeTables.hpp>
  -#include <xercesc/internal/XMLReader.hpp>
  -#include <xercesc/internal/XMLScanner.hpp>
  -#include <string.h>
  +
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -417,9 +412,9 @@
   
   XMLReader::~XMLReader()
   {
  -    delete [] fEncodingStr;
  -    delete [] fPublicId;
  -    delete [] fSystemId;
  +    XMLString::release(&fEncodingStr);
  +    XMLString::release(&fPublicId);
  +    XMLString::release(&fSystemId);
       delete fStream;
       delete fTranscoder;
   }
  @@ -1138,7 +1133,7 @@
           ||  !XMLString::compareString(inputEncoding, XMLUni::fgUTF16EncodingString4)
           ||  !XMLString::compareString(inputEncoding, XMLUni::fgUTF16EncodingString5))
           {
  -            delete [] inputEncoding;
  +            XMLString::release(&inputEncoding);
   
               if ((fEncoding != XMLRecognizer::UTF_16L)
               &&  (fEncoding != XMLRecognizer::UTF_16B))
  @@ -1150,11 +1145,11 @@
               newBaseEncoding = fEncoding;
   
               if (fEncoding == XMLRecognizer::UTF_16L) {
  -                delete [] fEncodingStr;
  +                XMLString::release(&fEncodingStr);
                   fEncodingStr = XMLString::replicate(XMLUni::fgUTF16LEncodingString);
               }
               else {
  -                delete [] fEncodingStr;
  +                XMLString::release(&fEncodingStr);
                   fEncodingStr = XMLString::replicate(XMLUni::fgUTF16BEncodingString);
               }
           }
  @@ -1162,7 +1157,7 @@
                ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString2)
                ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString3))
           {
  -            delete [] inputEncoding;
  +            XMLString::release(&inputEncoding);
   
               if ((fEncoding != XMLRecognizer::UCS_4L)
               &&  (fEncoding != XMLRecognizer::UCS_4B))
  @@ -1175,12 +1170,12 @@
   
               if (fEncoding == XMLRecognizer::UCS_4L) {
   
  -                delete [] fEncodingStr;
  +                XMLString::release(&fEncodingStr);
                   fEncodingStr = XMLString::replicate(XMLUni::fgUCS4LEncodingString);
               }
               else {
   
  -                delete [] fEncodingStr;
  +                XMLString::release(&fEncodingStr);
                   fEncodingStr = XMLString::replicate(XMLUni::fgUCS4BEncodingString);
               }
           }
  @@ -1190,7 +1185,7 @@
               // None of those special cases, so just replicate the new name
               // and use it directly to create the transcoder
               //
  -            delete [] fEncodingStr;
  +            XMLString::release(&fEncodingStr);
               fEncodingStr = inputEncoding;
   
               XMLTransService::Codes failReason;
  @@ -1205,7 +1200,7 @@
        else
       {
           // Store the new encoding string since it is just an intrinsic
  -        delete [] fEncodingStr;
  +        XMLString::release(&fEncodingStr);
           fEncodingStr = inputEncoding;
       }
   
  
  
  
  1.3       +10 -7     xml-xerces/c/src/xercesc/sax/InputSource.cpp
  
  Index: InputSource.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/InputSource.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InputSource.cpp	4 Nov 2002 14:56:26 -0000	1.2
  +++ InputSource.cpp	21 Apr 2003 21:07:38 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.3  2003/04/21 21:07:38  knoaman
  + * Use XMLString::release to prepare for configurable memory manager.
  + *
    * Revision 1.2  2002/11/04 14:56:26  tng
    * C++ Namespace Support.
    *
  @@ -99,9 +102,9 @@
   // ---------------------------------------------------------------------------
   InputSource::~InputSource()
   {
  -    delete [] fEncoding;
  -    delete [] fPublicId;
  -    delete [] fSystemId;
  +    XMLString::release(&fEncoding);
  +    XMLString::release(&fPublicId);
  +    XMLString::release(&fSystemId);
   }
   
   
  @@ -110,21 +113,21 @@
   // ---------------------------------------------------------------------------
   void InputSource::setEncoding(const XMLCh* const encodingStr)
   {
  -    delete [] fEncoding;
  +    XMLString::release(&fEncoding);
       fEncoding = XMLString::replicate(encodingStr);
   }
   
   
   void InputSource::setPublicId(const XMLCh* const publicId)
   {
  -    delete [] fPublicId;
  +    XMLString::release(&fPublicId);
       fPublicId = XMLString::replicate(publicId);
   }
   
   
   void InputSource::setSystemId(const XMLCh* const systemId)
   {
  -    delete [] fSystemId;
  +    XMLString::release(&fSystemId);
       fSystemId = XMLString::replicate(systemId);
   }
   
  
  
  
  1.4       +8 -5      xml-xerces/c/src/xercesc/sax/SAXParseException.cpp
  
  Index: SAXParseException.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/SAXParseException.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SAXParseException.cpp	4 Nov 2002 14:56:26 -0000	1.3
  +++ SAXParseException.cpp	21 Apr 2003 21:07:38 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2003/04/21 21:07:38  knoaman
  + * Use XMLString::release to prepare for configurable memory manager.
  + *
    * Revision 1.3  2002/11/04 14:56:26  tng
    * C++ Namespace Support.
    *
  @@ -135,8 +138,8 @@
   
   SAXParseException::~SAXParseException()
   {
  -    delete [] fPublicId;
  -    delete [] fSystemId;
  +    XMLString::release(&fPublicId);
  +    XMLString::release(&fSystemId);
   }
   
   
  @@ -153,8 +156,8 @@
       fColumnNumber = toAssign.fColumnNumber;
       fLineNumber = toAssign.fLineNumber;
   
  -    delete [] fPublicId;
  -    delete [] fSystemId;
  +    XMLString::release(&fPublicId);
  +    XMLString::release(&fSystemId);
       fPublicId = XMLString::replicate(toAssign.fPublicId);
       fSystemId = XMLString::replicate(toAssign.fSystemId);
   
  
  
  

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