Re: Proposal: Ref Counting Conventions



On Tue, May 16, 2000 at 06:04:59PM -0400, Miguel de Icaza wrote:
> The inout is not part of any spec I can find in my COM books that i
> have here, and I would doubt that they did something as stupid as
> unrefing an in parameter for the inout case.  And if they did, then I
> would agree with some people that some Microsoft hackers do stupid
> things. 

FWIW, according "Inside Com" by Dale Rogerson, the rule is to 
unref the inout out parameter before changing it. (Chapter 4,
referred to as "The In-Out Paramter Rule", page 82 in my copy).

I'll quote...

A function must call Release on an interface pointer passes via an
in-out parameter before overwriting the in parameter with another
interface pointer. The function must also call AddRef on the out
paramter before returning to the caller.

I leave to greater minds to decide if that is wise or not :) I'm just
trying to get up to speed on bonobo. 

HTH,
Sam <shunter@bigsky.net>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]