Commit 2f707558 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

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).
parent 1967b359
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment