I sent following reply to [EMAIL PROTECTED] while back, but
do not see it show up in my mail-box.  So I am resending this message
through the news group.  Sorry if you recieve this message twice.

John Bandhauer wrote:

> Kenichi Komiya wrote:

>> 
>>       nsIIDPtr getIIDForParam(in PRUint16 methodIndex,
>>                              [const] in nsXPTParamInfoPtr param);
>> 
>> In my naive understanding, all out param (and returned value for that
>> matter) should be freed by the caller (unless they are shared).  But
>> the implementation and clients of this interface seem to agree that
>> the retruned nsIIDPtr need not be freed by caller.

> Huh? I can't speak for the PyXPCOM caller in the tree. But the
> implementation in xpti and the callers in xpconnect go to a lot
> of trouble to balance the cloning and freeing of the resultant
> iid. You were correct in your understanding of the rules, you
> just didn't dig deep enough when looking at the cases where
> getIIDForParam is used.


Thank you for the clarification and references.

Actually, what I read (or I thought I read) was
nsXPCWrappedJSClass::GetInterfaceTypeFromParam().  I overlooked
iisIsOwned, saw no nsMemory::Free in the function and then
immediately jumped into the wrong conclusion.

Now I see it does what I was expecting, only in a place, my
shallow understanding could not reach.  Got a leak to fix in my
code ...

Thanks,
Kenichi Komiya.


Reply via email to