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 2003/06/07 02:04:58 UTC

cvs commit: xml-xalan/c/src/XalanTransformer XalanTransformer.cpp XalanTransformer.hpp

dbertoni    2003/06/06 17:04:58

  Modified:    c/src/XalanTransformer XalanTransformer.cpp
                        XalanTransformer.hpp
  Log:
  Make static XSLTInputSource instance a pointer, so things work with the new Xerces-C memory management code.
  
  Revision  Changes    Path
  1.69      +7 -2      xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
  
  Index: XalanTransformer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- XalanTransformer.cpp	8 May 2003 00:15:28 -0000	1.68
  +++ XalanTransformer.cpp	7 Jun 2003 00:04:57 -0000	1.69
  @@ -132,7 +132,7 @@
   XALAN_CPP_NAMESPACE_BEGIN
   
   
  -const XSLTInputSource	XalanTransformer::s_emptyInputSource;
  +const XSLTInputSource*	XalanTransformer::s_emptyInputSource = 0;
   
   const XSLTInit*			XalanTransformer::s_xsltInit = 0;
   
  @@ -204,6 +204,7 @@
   XalanTransformer::initialize()
   {
   	// Initialize Xalan. 
  +	s_emptyInputSource = new XSLTInputSource;
   	s_xsltInit = new XSLTInit;
   
   	XalanExtensionsInstaller::installGlobal();
  @@ -227,8 +228,10 @@
   {
   	// Terminate Xalan and release memory.
   #if defined(XALAN_CANNOT_DELETE_CONST)
  +	delete (XSLTInputSource*) s_emptyInputSource
   	delete (XSLTInit*) s_xsltInit;
   #else
  +	delete s_emptyInputSource;
   	delete s_xsltInit;
   #endif
   
  @@ -402,6 +405,8 @@
   			XalanOutputHandlerType		theOutputHandler,
   			XalanFlushHandlerType		theFlushHandler)
   {
  +	assert(s_emptyInputSource != 0);
  +
   	// Set to output target to the callback 
   	XalanTransformerOutputStream	theOutputStream(theOutputHandle, theOutputHandler, theFlushHandler);
   
  @@ -412,7 +417,7 @@
   	// Do the transformation...
   	return transform(
   					theInputSource, 
  -					s_emptyInputSource,
  +					*s_emptyInputSource,
   					theResultTarget);
   }
   
  
  
  
  1.50      +6 -3      xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp
  
  Index: XalanTransformer.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- XalanTransformer.hpp	27 Mar 2003 23:08:01 -0000	1.49
  +++ XalanTransformer.hpp	7 Jun 2003 00:04:57 -0000	1.50
  @@ -231,8 +231,9 @@
   			const XalanParsedSource&	theParsedXML, 		 		 
   			const XSLTResultTarget&		theResultTarget)
   	{
  +		assert(s_emptyInputSource != 0);
   
  -		return transform(theParsedXML, s_emptyInputSource, theResultTarget);
  +		return transform(theParsedXML, *s_emptyInputSource, theResultTarget);
   	}
   
   	/**
  @@ -267,9 +268,11 @@
   			const XSLTInputSource&		theInputSource,
   			const XSLTResultTarget& 	theResultTarget)
   	{
  +		assert(s_emptyInputSource != 0);
  +
   		return transform(
   						theInputSource, 
  -						s_emptyInputSource,
  +						*s_emptyInputSource,
   						theResultTarget);
   	}
   
  @@ -957,7 +960,7 @@
   	// This should always be the latest data member!!!
   	StylesheetExecutionContextDefault*		m_stylesheetExecutionContext;
   
  -	static const XSLTInputSource			s_emptyInputSource;
  +	static const XSLTInputSource*			s_emptyInputSource;
   
   	static const XSLTInit*					s_xsltInit;
   };
  
  
  

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