views:

34

answers:

1

Hi,

Purify is pointing memory leak in ole32.dll while returning a Variant with VT set to VT_RECORD as OUT parameter. I am using User Marshalling by generating proxy/stub dll from IDL. Can you suggest how to avoid this memory leak?

Struct defined in IDL:

{
BSTR m_sFirst;
BSTR m_sSecond;
VARIANT m_vChildStruct; //This member encapsulate a sub structure 
SAFEARRAY __RPC_FAR * m_saArray;
}CustomINFO;

Encapsulation of struct in variant:

I am allocating the memory for the structs using CoTaskMemAlloc and encapsulating it in Variant as follows:

vV->vt = VT_RECORD;
vV->pvRecord = pStruct; //Pointer of sturct
vV->pRecInfo = pRI; //RecordInfo Interface

Thanks

Picaro De Vosio

A: 

there are limitations in support of VT_RECORD. Try checking with http://vcfaq.mvps.org/com/4.htm, might help.

It might also be more helpful if you describe your case in more details (related IDL parts, commpiler version and code describing client/server communication which Purify suspects as leaking )

Andrey