Re: Glib::RefPtr and Pointer



Hi,

Am Freitag, den 09.11.2007, 08:34 +0100 schrieb Murray Cumming:

> > m_refListModel.clear ();
> > 
> > This compiled nice, but m_refListModel was NULL after calling this.
> > 
> > m_refListModel->clear ();
> > 
> > This worked as I expected. After reading the documentation of RefPtr, I
> > know the problem. This was a *really* hard to find bug!
> 
> We've all made that mistake once.
> 
> I would rename the clear() method on some classes if it didn't meant
> that hundreds of applications would break.

If we ever get the opportunity to fix this, RefPtr<>::clear() should be
renamed to reset() -- analogous to std::auto_ptr<>::reset().  clear() is
for containers.

--Daniel




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