[haiku-commits] Re: r42079 - in haiku/trunk: headers/private/shared src/kits/support

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 10 Jun 2011 09:45:32 +0200

On 2011-06-10 at 08:43:09 [+0200], Jérôme Duval <korli@xxxxxxxxxxxxxxxx> 
wrote:
> 2011/6/10  <anevilyak@xxxxxxxxx>:
> >
> > -                       void                            
> > AcquireReference();
> > +                       int32                           
> > AcquireReference();
> >                        bool                            ReleaseReference();
> >                                     // returns true after last
> 
> Returning bool would have been sufficient for your case, and even
> symmetric with ReleaseReference() :)

Either that or change the ReleaseReference() return type to int32 as well. 
While I haven't encountered a case yet where the exact count is of interest, 
it would at least be imaginable. E.g. when one or more entities are known to 
hold a reference and one would decide for disposing the object at a reference 
count greater than 0. On the other hand one wouldn't really make use of the 
BReferenceable features anymore. But then again a subclass used like this 
might be used like a normal referenceable in a different context, and it 
would be a little stupid to introduce another reference counting facility for 
the first purpose.

CU, Ingo

Other related posts: