[haiku-commits] Re: r38787 - in haiku/trunk/src/apps/debugger: . user_interface/gui/teams_window

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 22 Sep 2010 14:49:29 +0200

On 2010-09-22 at 14:54:57 [+0200], Stephan Assmus <superstippi@xxxxxx> 
wrote:
> Hi,
> 
> > @@ -245,7 +246,7 @@
> >  
> >              TeamListItem* item = new(std::nothrow) TeamListItem(team);
> >              if (item != NULL) {
> > -                AddItem(new TeamListItem(team));
> > +                AddItem(item);
> >                  SortItems(&TeamListItem::Compare);
> >              }
> >              break;
> 
> BTW, if AddItem() is the BList AddItem(), it potentially returns "false", 
> since it potentially needs to make an allocation itself. So the correct 
> code would be to check the AddItem() return value and delete the item if 
> it's "false" and then bail out.

Good hint. Apparently that had been forgotten in the TeamWindow as well.

CU, Ingo

Other related posts: