Re: [gtkmm] "manage" and Glib::RefPtr



Am Don, 2002-10-10 um 18.29 schrieb Christof Petig:
> 
> > What would manage_ref() do?  I think it would be the same as writing
> > Glib::RefPtr<Foo>(new Foo()) directly (though that won't work with
> > special cased widgets like GtkWindow or GtkInvisible).  Therefore we
> > don't really need a function to do that.
> 
> No, it would explicitely allow the widget to get refcounted. This way we 
> would get a working refcounting solution while maintaining 
> compatibility. Refcounting as an optional add-on ;-(

It's no add-on, GTK+ does it itself all the time.  If we'd do it the way
I'm proposing but without enforcing the use of RefPtr<> we wouldn't even
loose backward compatibility.  It'd be dangerous (at it is now) and
allow bad style though.  (Yes, I really think that using delete in high
level C++ code is bad style.)

> I think that having designed a decent refcounting solution should not 
> render working code broken.

Yes, but I think we should make it simpler, not more complex.

--Daniel





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