You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2008/11/19 21:07:07 UTC

svn commit: r719046 [6/6] - in /xalan/c/trunk: Projects/Win32/VC6/AllInOne/ Projects/Win32/VC7.1/AllInOne/ Projects/Win32/VC7/AllInOne/ Projects/Win32/VC8/AllInOne/ Projects/Win32/VC9/AllInOne/ src/xalanc/Harness/ src/xalanc/ICUBridge/ src/xalanc/Inclu...

Modified: xalan/c/trunk/src/xalanc/XalanTransformer/XalanTransformer.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanTransformer/XalanTransformer.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanTransformer/XalanTransformer.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanTransformer/XalanTransformer.cpp Wed Nov 19 12:07:05 2008
@@ -31,8 +31,6 @@
 #include <xercesc/sax/SAXParseException.hpp>
 
 
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
-
 
 #include <xalanc/XalanDOM/XalanDOMException.hpp>
 
@@ -134,11 +132,11 @@
 #if defined(XALAN_USE_ICU)
     // Create a collation function for the ICU, and have it
     // cache collators...
-    XalanMemMgrAutoPtr<ICUBridgeCollationCompareFunctor, true>  theICUFunctor(m_memoryManager, ICUBridgeCollationCompareFunctor::create(m_memoryManager, true));
+    XalanMemMgrAutoPtr<ICUBridgeCollationCompareFunctor>  theICUFunctor(m_memoryManager, ICUBridgeCollationCompareFunctor::create(m_memoryManager, true));
 
     m_stylesheetExecutionContext->installCollationCompareFunctor(theICUFunctor.get());
 
-    XalanMemMgrAutoPtr<ICUFormatNumberFunctor, true>  theFormatNumberFunctor(m_memoryManager, ICUFormatNumberFunctor::create(m_memoryManager));
+    XalanMemMgrAutoPtr<ICUFormatNumberFunctor>  theFormatNumberFunctor(m_memoryManager, ICUFormatNumberFunctor::create(m_memoryManager));
     m_stylesheetExecutionContext->installFormatNumberFunctor(theFormatNumberFunctor.get());
     theICUFunctor.release();
     theFormatNumberFunctor.release();
@@ -172,14 +170,19 @@
 
 #if defined(XALAN_USE_ICU)
     // Uninstall the ICU collation compare functor, and destroy it...
+    XalanDestroy(
+        m_memoryManager,
+        m_stylesheetExecutionContext->uninstallCollationCompareFunctor());
 
-    destroyObjWithMemMgr( m_stylesheetExecutionContext->uninstallCollationCompareFunctor(), m_memoryManager);
-    destroyObjWithMemMgr( m_stylesheetExecutionContext->uninstallFormatNumberFunctor(), m_memoryManager);
+    // Uninstall the ICU format number functor, and destroy it...
+    XalanDestroy(
+        m_memoryManager,
+        m_stylesheetExecutionContext->uninstallFormatNumberFunctor());
 #endif
 
-    destroyObjWithMemMgr(
-        m_stylesheetExecutionContext,
-        m_memoryManager);
+    XalanDestroy(
+        m_memoryManager,
+        m_stylesheetExecutionContext);
 }
 
 
@@ -188,7 +191,7 @@
 XalanTransformer::initialize(MemoryManager&     theManager)
 {
     // Initialize Xalan. 
-    XalanMemMgrAutoPtr<XSLTInit, true>          initGuard(theManager, XSLTInit::create(theManager));
+    XalanMemMgrAutoPtr<XSLTInit>    initGuard(theManager, XSLTInit::create(theManager));
     XalanAutoPtr<XSLTInputSource>   inputSourceGuard(new (&theManager) XSLTInputSource(theManager));
     EnsureFunctionsInstallation     instalGuard(theManager); 
 
@@ -206,7 +209,7 @@
 void
 XalanTransformer::terminate()
 {
-    assert( s_initMemoryManager!= 0 );
+    assert(s_initMemoryManager != 0);
 
     {
         const EnsureFunctionsInstallation   uninstallGuard(*s_initMemoryManager);
@@ -214,7 +217,9 @@
 
     delete s_emptyInputSource;
 
-    destroyObjWithMemMgr(s_xsltInit, *s_initMemoryManager);
+    XalanDestroy(
+        *s_initMemoryManager,
+        const_cast<XSLTInit*>(s_xsltInit));
 
     s_emptyInputSource = 0;
     s_xsltInit = 0;
@@ -719,9 +724,9 @@
     {
         m_compiledStylesheets.erase(i);
 
-        destroyObjWithMemMgr(
-            theStylesheet,
-            m_memoryManager);
+        XalanDestroy(
+            m_memoryManager,
+            const_cast<XalanCompiledStylesheet*>(theStylesheet));
 
         return 0;
     }
@@ -848,9 +853,9 @@
 
         assert(theParsedSource != 0);
 
-        destroyObjWithMemMgr(
-            theParsedSource,
-            m_memoryManager);
+        XalanDestroy(
+            m_memoryManager,
+            const_cast<XalanParsedSource*>(theParsedSource));
 
         return 0;
     }
@@ -1181,7 +1186,7 @@
         assert(theSourceDocument != 0);
 
         // Create the helper object that is necessary for running the processor...
-        XalanMemMgrAutoPtr<XalanParsedSourceHelper, true>   theHelper(m_memoryManager, theParsedXML.createHelper(m_memoryManager));
+        XalanMemMgrAutoPtr<XalanParsedSourceHelper>   theHelper(m_memoryManager, theParsedXML.createHelper(m_memoryManager));
 
         assert(theHelper.get() != 0);
 

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -52,25 +52,31 @@
     assert(theXercesCDATASection != 0);
 }
 
+
+    
 XercesCDATASectionWrapper*
-XercesCDATASectionWrapper::create( MemoryManager& theManager,
+XercesCDATASectionWrapper::create(
+            MemoryManager&                  theManager,
             const DOMCDATASectionType*      theXercesCDATASection,
             const XercesWrapperNavigator&   theNavigator)
 
 {
-    typedef XercesCDATASectionWrapper ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesCDATASectionWrapper   ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theXercesCDATASection, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesCDATASection,
+                                theNavigator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesCDATASectionWrapper::~XercesCDATASectionWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -48,25 +48,31 @@
     assert(theXercesComment != 0);
 }
 
+
+
 XercesCommentWrapper*
-XercesCommentWrapper::create( MemoryManager& theManager,
-                             const DOMCommentType*          theXercesComment,
-                             const XercesWrapperNavigator&  theNavigator)
+XercesCommentWrapper::create(
+            MemoryManager&                  theManager,
+            const DOMCommentType*          theXercesComment,
+            const XercesWrapperNavigator&  theNavigator)
 
 {
-    typedef XercesCommentWrapper ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesCommentWrapper    ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theXercesComment, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesComment,
+                                theNavigator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesCommentWrapper::~XercesCommentWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -56,23 +56,27 @@
 {
 }
 
+
+
 XercesDOMImplementationWrapper*
-XercesDOMImplementationWrapper::create(MemoryManager& theManager, DOMImplementationType*    theXercesDOMImplementation)
+XercesDOMImplementationWrapper::create(
+            MemoryManager&          theManager,
+            DOMImplementationType*  theXercesDOMImplementation)
 {
-        typedef XercesDOMImplementationWrapper ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesDOMImplementationWrapper  ThisType;
 
-        ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        new (theResult) ThisType(theXercesDOMImplementation);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theXercesDOMImplementation);
 
-        theGuard.release();
+    theGuard.release();
 
-        return theResult;
+    return theResult;
 }
 
 
+
 bool
 XercesDOMImplementationWrapper::hasFeature(
             const XalanDOMString&   feature,

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -52,24 +52,30 @@
     assert(theXercesDOMDocumentType != 0);
 }
 
+
+
 XercesDocumentTypeWrapper*
-XercesDocumentTypeWrapper::create( MemoryManager& theManager,
+XercesDocumentTypeWrapper::create(
+            MemoryManager&                  theManager,
             const DOMDocumentType_Type*     theXercesDOMDocumentType,
             const XercesWrapperNavigator&   theNavigator)
 {
-    typedef XercesDocumentTypeWrapper ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesDocumentTypeWrapper   ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theXercesDOMDocumentType, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesDOMDocumentType,
+                                theNavigator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesDocumentTypeWrapper::~XercesDocumentTypeWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -75,7 +75,7 @@
 
 
 XercesDocumentWrapper::XercesDocumentWrapper(
-            MemoryManager&          theManager,
+            MemoryManager&              theManager,
             const DOMDocument_Type*     theXercesDocument,
             bool                        threadSafe,
             bool                        buildWrapper,
@@ -117,31 +117,35 @@
     }
 }
 
+
+
 XercesDocumentWrapper*
 XercesDocumentWrapper::create( 
-            MemoryManager&          theManager,
+            MemoryManager&              theManager,
             const DOMDocument_Type*     theXercesDocument,
             bool                        threadSafe,
             bool                        buildWrapper,
             bool                        buildMaps)
 {
-    typedef XercesDocumentWrapper ThisType;
+    typedef XercesDocumentWrapper   ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                theXercesDocument,
+                                threadSafe,
+                                buildWrapper,
+                                buildMaps);
 
-    new (theResult) ThisType(theManager,
-                            theXercesDocument,
-                            threadSafe,
-                            buildWrapper,
-                            buildMaps);
-        
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesDocumentWrapper::~XercesDocumentWrapper()
 {
     destroyWrapper();

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp Wed Nov 19 12:07:05 2008
@@ -465,37 +465,37 @@
     // This is a private helper class for building the tree...
     friend class BuildWrapperTreeWalker;
 
-    const DOMDocument_Type* const           m_xercesDocument;
+    const DOMDocument_Type* const                   m_xercesDocument;
 
-    XalanElement*                           m_documentElement;
+    XalanElement*                                   m_documentElement;
 
-    mutable XercesWrapperToXalanNodeMap     m_nodeMap;
+    mutable XercesWrapperToXalanNodeMap             m_nodeMap;
 
-    mutable XercesWrapperNavigatorAllocator m_navigatorAllocator;
+    mutable XercesWrapperNavigatorAllocator         m_navigatorAllocator;
 
     // Our navigator will be the first entry in m_navigators,
     // but we'll cache this so access is faster...
-    XercesWrapperNavigator*                 m_navigator;
+    XercesWrapperNavigator*                         m_navigator;
 
-    XercesNodeListWrapper                   m_children;
+    XercesNodeListWrapper                           m_children;
 
-    mutable NodeVectorType                  m_nodes;
+    mutable NodeVectorType                          m_nodes;
 
-    mutable XercesDocumentTypeWrapper*      m_doctype;
+    mutable XercesDocumentTypeWrapper*              m_doctype;
 
-    bool                                    m_mappingMode;
+    bool                                            m_mappingMode;
 
-    bool                                    m_indexValid;
+    bool                                            m_indexValid;
 
-    const bool                              m_buildMaps;
+    const bool                                      m_buildMaps;
 
-    mutable XercesElementWrapperAllocator   m_elementAllocator;
+    mutable XercesElementWrapperAllocator           m_elementAllocator;
 
-    mutable XercesTextWrapperAllocator      m_textAllocator;
+    mutable XercesTextWrapperAllocator              m_textAllocator;
 
-    mutable XercesAttrWrapperAllocator      m_attributeAllocator;
+    mutable XercesAttrWrapperAllocator              m_attributeAllocator;
 
-    const XalanMemMgrAutoPtr<XalanDOMStringPool,true>  m_stringPool;
+    const XalanMemMgrAutoPtr<XalanDOMStringPool>    m_stringPool;
 };
 
 

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -50,19 +50,23 @@
     assert(theXercesDOMEntityReference != 0);
 }
 
+
+
 XercesEntityReferenceWrapper*
-XercesEntityReferenceWrapper::create( MemoryManager& theManager,
+XercesEntityReferenceWrapper::create(
+            MemoryManager&                  theManager,
             const DOMEntityReferenceType*   theXercesDOMEntityReference,
             const XercesWrapperNavigator&   theNavigator)
 
 {
-    typedef XercesEntityReferenceWrapper ThisType;
+    typedef XercesEntityReferenceWrapper    ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theXercesDOMEntityReference, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesDOMEntityReference,
+                                theNavigator);
 
     theGuard.release();
 
@@ -70,6 +74,7 @@
 }
 
 
+
 XercesEntityReferenceWrapper::~XercesEntityReferenceWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -50,25 +50,31 @@
     assert(theXercesDOMEntity != 0);
 }
 
+
+    
 XercesEntityWrapper*
-XercesEntityWrapper::create( MemoryManager& theManager,
+XercesEntityWrapper::create(
+            MemoryManager&                  theManager,
             const DOMEntityType*            theXercesDOMEntity,
             const XercesWrapperNavigator&   theNavigator)
 
 {
-    typedef XercesEntityWrapper ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesEntityWrapper     ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theXercesDOMEntity, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesDOMEntity,
+                                theNavigator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesEntityWrapper::~XercesEntityWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -48,19 +48,23 @@
     assert(theXercesDOMNotation != 0);
 }
 
+
+
 XercesNotationWrapper*
-XercesNotationWrapper::create( MemoryManager& theManager,
+XercesNotationWrapper::create(
+            MemoryManager&                  theManager,
             const DOMNotationType*          theXercesDOMNotation,
             const XercesWrapperNavigator&   theNavigator)
 
 {
-    typedef XercesNotationWrapper ThisType;
+    typedef XercesNotationWrapper   ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theXercesDOMNotation, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesDOMNotation,
+                                theNavigator);
 
     theGuard.release();
 
@@ -68,6 +72,7 @@
 }
 
 
+
 XercesNotationWrapper::~XercesNotationWrapper()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp Wed Nov 19 12:07:05 2008
@@ -272,8 +272,9 @@
 
     if (i != m_documentMap.end())
     {
-        const XalanMemMgrAutoPtr<XalanDocument, true>   theGuard(m_documentMap.getMemoryManager(),
-                                                                 theDocument);
+        const XalanMemMgrAutoPtr<XalanDocument>     theGuard(
+                                                        m_documentMap.getMemoryManager(),
+                                                        theDocument);
 
         m_documentMap.erase(i);
     }

Modified: xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -48,25 +48,31 @@
     assert(theXercesDOMProcessingInstruction != 0);
 }
 
+
+    
 XercesProcessingInstructionWrapper*
-XercesProcessingInstructionWrapper::create( MemoryManager& theManager,
+XercesProcessingInstructionWrapper::create(
+            MemoryManager&                          theManager,
             const DOMProcessingInstructionType*     theXercesDOMProcessingInstruction,
             const XercesWrapperNavigator&           theNavigator)
 
 {
-    typedef XercesProcessingInstructionWrapper ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XercesProcessingInstructionWrapper  ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theXercesDOMProcessingInstruction, theNavigator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theXercesDOMProcessingInstruction,
+                                theNavigator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XercesProcessingInstructionWrapper::~XercesProcessingInstructionWrapper()
 {
 }



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