dbertoni    00/05/26 12:21:51

  Modified:    c/src/XSLT Stylesheet.cpp
  Log:
  Fixed memory leak.
  
  Revision  Changes    Path
  1.18      +16 -7     xml-xalan/c/src/XSLT/Stylesheet.cpp
  
  Index: Stylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Stylesheet.cpp    2000/05/12 18:21:31     1.17
  +++ Stylesheet.cpp    2000/05/26 19:21:50     1.18
  @@ -99,6 +99,7 @@
   #include "ElemTemplate.hpp"
   #include "ElemTemplateElement.hpp"
   #include "ElemVariable.hpp"
  +#include "ExtensionNSHandler.hpp"
   #include "KeyTable.hpp"
   #include "StylesheetConstructionContext.hpp"
   #include "StylesheetExecutionContext.hpp"
  @@ -192,13 +193,18 @@
        for_each(m_elemDecimalFormats.begin(),
                         m_elemDecimalFormats.end(),
                         DeleteFunctor<ElemDecimalFormat>());
  -     
  -     // Clean up the match pattern vector
  -     PatternTableMapType::iterator   it = m_patternTable.begin();
  +
  +     // Clean up the extension namespaces vector
  +     for_each(m_extensionNamespaces.begin(),
  +                      m_extensionNamespaces.end(),
  +                      MapValueDeleteFunctor<ExtensionNamespacesMapType>());
   
  -     for ( ; it != m_patternTable.end(); it++)
  +     // Clean up the match pattern vector
  +     for (PatternTableMapType::const_iterator        it = 
m_patternTable.begin();
  +                     it != m_patternTable.end();
  +                             ++it)
        {
  -             PatternTableListType&   theList = it->second;
  +             const PatternTableListType&             theList = it->second;
   
                for_each(theList.begin(),
                                 theList.end(),
  @@ -623,7 +629,7 @@
                        // Points to the current list of match patterns.  Note
                        // that this may point to more than one table.
                        const PatternTableListType*     matchPatternList = 0;
  -                     int targetNodeType = targetNode->getNodeType();
  +                     const XalanNode::NodeType               targetNodeType 
= targetNode->getNodeType();
   
                        switch(targetNodeType)
                        {
  @@ -1061,7 +1067,10 @@
   }
   
   
  -void Stylesheet::addExtensionNamespace (const XalanDOMString& uri, 
ExtensionNSHandler* nsh)
  +void
  +Stylesheet::addExtensionNamespace(
  +                     const XalanDOMString&   uri,
  +                     ExtensionNSHandler*             nsh)
   {
        
m_extensionNamespaces.insert(ExtensionNamespacesMapType::value_type(uri, nsh));
   }
  
  
  

Reply via email to