[haiku-commits] Re: haiku: hrev48711 - src/servers/app/drawing

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 23 Jan 2015 14:06:06 +0100

On Fri, Jan 23, 2015 at 07:57:59AM -0500, Rene Gollent wrote:
> On Fri, Jan 23, 2015 at 7:46 AM,  <pulkomandy@xxxxxxxxxxxxx> wrote:
> >                         color_space                     fColorSpace;
> >                         BitmapHWInterface*      fHWInterface;
> > -                       UtilityBitmap*          fBitmap;
> > +                       BReference<UtilityBitmap> fBitmap;
> >                         BRegion                         fClipping;
> >  };
> >
> >
> >
> 
> I should further note, is fBitmap always assigned a reference to an
> already existing UtilityBitmap? I see no adjustments in this commit to
> the places where its value is assigned, so if it's ever the case that
> said assignment is a freshly created one via operator=, you're
> potentially leaking a reference here.

The bitmap is owned by this class, it is not shared or exposed anywhere.
Only newly created objects are assigned to it, but you are right, this
leaks a reference. I'm changing this to use ReleaseReference instead as
it is simpler and better.

-- 
Adrien.

Other related posts: