From 2f707558fcd29df82afd71338591dd596807ae3a Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 30 Jul 2013 15:20:04 +0200 Subject: [PATCH] oleaut32: Store PARAMDESCEX structure inside lprgelemdescParam. Thanks to this change we don't need to free the data differently depending on how it was created (by typelib reading or writing code). --- dlls/oleaut32/typelib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 44eea5b8979..a8916d80c44 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -2356,7 +2356,7 @@ MSFT_DoFuncs(TLBContext* pcx, MSFT_ParameterInfo paraminfo; ptfd->funcdesc.lprgelemdescParam = - heap_alloc_zero(pFuncRec->nrargs * sizeof(ELEMDESC)); + heap_alloc_zero(pFuncRec->nrargs * (sizeof(ELEMDESC) + sizeof(PARAMDESCEX))); ptfd->pParamDesc = TLBParDesc_Constructor(pFuncRec->nrargs); @@ -2390,7 +2390,7 @@ MSFT_DoFuncs(TLBContext* pcx, PARAMDESC* pParamDesc = &elemdesc->u.paramdesc; - pParamDesc->pparamdescex = heap_alloc_zero(sizeof(PARAMDESCEX)); + pParamDesc->pparamdescex = (PARAMDESCEX*)(ptfd->funcdesc.lprgelemdescParam+pFuncRec->nrargs)+j; pParamDesc->pparamdescex->cBytes = sizeof(PARAMDESCEX); MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue), @@ -5441,10 +5441,7 @@ static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This) { ELEMDESC *elemdesc = &pFInfo->funcdesc.lprgelemdescParam[j]; if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) - { VariantClear(&elemdesc->u.paramdesc.pparamdescex->varDefaultValue); - heap_free(elemdesc->u.paramdesc.pparamdescex); - } TLB_FreeCustData(&pFInfo->pParamDesc[j].custdata_list); } heap_free(pFInfo->funcdesc.lprgelemdescParam);