[haiku-commits] Re: r40762 - haiku/trunk/src/apps/terminal

On 2011-03-02 at 10:04:17 [+0100], Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> 
> On 2011-03-01 at 19:00:28 [+0100], kallisti5@xxxxxxxxxxx wrote:
> > Author: kallisti5
> > Date: 2011-03-01 19:00:28 +0100 (Tue, 01 Mar 2011)
> > New Revision: 40762
> > Changeset: http://dev.haiku-os.org/changeset/40762
> > 
> > Modified:
> >    haiku/trunk/src/apps/terminal/TerminalRoster.cpp
> > Log:
> > remove a double free of fOurInfo. CID 10563
> > 
> > Modified: haiku/trunk/src/apps/terminal/TerminalRoster.cpp
> > ===================================================================
> > --- haiku/trunk/src/apps/terminal/TerminalRoster.cpp    2011-03-01 
> > 16:19:38
> > UTC (rev 40761)
> > +++ haiku/trunk/src/apps/terminal/TerminalRoster.cpp    2011-03-01 
> > 18:00:28
> > UTC (rev 40762)
> > @@ -257,7 +257,6 @@
> >  
> >      // remove our info and update the clipboard
> >      fInfos.RemoveItem(fOurInfo);
> > -    delete fOurInfo;
> >      fOurInfo = NULL;
> >  
> >      _UpdateClipboard();
> 
> Am I the only one thinking that the BObjectList::RemoveItem() deleteIfOwning
> parameter should not have a default? I find the current situation rather
> inconsistent with RemoveItemAt() which doesn't have such a parameter and
> doesn't delete the object either.

Oops, I suppose both methods should take a non-defaulting parameter then. By 
being required to write true or false, one is forced to actually think about 
whether or not the item should be deleted ;-)

cheers,
        Oliver

Other related posts: