diff options
Diffstat (limited to 'cppu/source/uno/destr.hxx')
-rw-r--r-- | cppu/source/uno/destr.hxx | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/cppu/source/uno/destr.hxx b/cppu/source/uno/destr.hxx index d8b2f70bfc47..cadf310d00a9 100644 --- a/cppu/source/uno/destr.hxx +++ b/cppu/source/uno/destr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: destr.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: jl $ $Date: 2001-03-12 13:27:08 $ + * last change: $Author: jsc $ $Date: 2001-03-30 13:41:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,6 +112,27 @@ inline void __destructStruct( (char *)pValue + pMemberOffsets[nDescr], ppTypeRefs[nDescr], release ); } } +//-------------------------------------------------------------------------------------------------- +inline void __destructArray( + void * pValue, + typelib_ArrayTypeDescription * pTypeDescr, + uno_ReleaseFunc release ) + throw () +{ + typelib_TypeDescription * pElementType = NULL; + TYPELIB_DANGER_GET( &pElementType, ((typelib_IndirectTypeDescription *)pTypeDescr)->pType ); + sal_Int32 nElementSize = pElementType->nSize; + TYPELIB_DANGER_RELEASE( pElementType ); + + sal_Int32 nTotalElements = pTypeDescr->nTotalElements; + for(sal_Int32 i=0; i < nTotalElements; i++) + { + ::uno_type_destructData((sal_Char *)pValue + i * nElementSize, + ((typelib_IndirectTypeDescription *)pTypeDescr)->pType, release ); + } + + typelib_typedescriptionreference_release(((typelib_IndirectTypeDescription *)pTypeDescr)->pType); +} //================================================================================================== void destructSequence( uno_Sequence ** ppSequence, @@ -393,6 +414,18 @@ inline void __destructData( TYPELIB_DANGER_RELEASE( pTypeDescr ); } break; + case typelib_TypeClass_ARRAY: + if (pTypeDescr) + { + __destructArray( pValue, (typelib_ArrayTypeDescription *)pTypeDescr, release ); + } + else + { + TYPELIB_DANGER_GET( &pTypeDescr, pType ); + __destructArray( pValue, (typelib_ArrayTypeDescription *)pTypeDescr, release ); + TYPELIB_DANGER_RELEASE( pTypeDescr ); + } + break; case typelib_TypeClass_UNION: if (pTypeDescr) { |