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 2005/05/04 22:09:04 UTC

cvs commit: xml-xalan/c/src/xalanc/Include XalanMemMgrHelper.hpp

dbertoni    2005/05/04 13:09:04

  Modified:    c/src/xalanc/Include XalanMemMgrHelper.hpp
  Log:
  Fix for Jira issue XALANC-504.
  
  Revision  Changes    Path
  1.2       +12 -6     xml-xalan/c/src/xalanc/Include/XalanMemMgrHelper.hpp
  
  Index: XalanMemMgrHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/Include/XalanMemMgrHelper.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanMemMgrHelper.hpp	8 Nov 2004 18:08:50 -0000	1.1
  +++ XalanMemMgrHelper.hpp	4 May 2005 20:09:04 -0000	1.2
  @@ -86,14 +86,20 @@
   
   template <class Type>
   void
  -destroyObjWithMemMgr( Type* ptr, MemoryManagerType& theManager)
  +destroyObjWithMemMgr(const Type* ptr, MemoryManagerType& theManager)
   {
  -    if( ptr == 0 )
  -        return;
  +    if (ptr != 0)
  +    {
  +        Type* const     nonConstPointer =
  +#if defined(XALAN_OLD_STYLE_CASTS)
  +            (const Type*)ptr;
  +#else
  +            const_cast<Type*>(ptr);
  +#endif
  +        nonConstPointer->~Type();
   
  -    ptr->~Type();
  -
  -    theManager.deallocate((void*)ptr);
  +        theManager.deallocate(nonConstPointer);
  +    }
   }
   
   
  
  
  

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