On Sun, 2008-07-27 at 12:22 +0900, Ryan McDougall wrote: > Reading the documentation here: > http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-memory-shared-resources.html > > It says that "some" objects need the RefPtr, and indeed looking at the > code it would seem that some Gtk:: objects do use RefPtr,
Anything that can't be constructed without a create*() method needs a RefPtr, and you are forced to use a RefPtr, so there's not much room for confusion. > where others > are naked (presumably left up to me to decide what to do with their > memory). > Ex: Gtk::VBox packingbox_; > Glib::RefPtr<Gtk::UIManager> uimanager_; > Glib::RefPtr<Gtk::ActionGroup> actiongroup_; > > Is there a canonical list of which widgets do and don't? No, but how would this be useful? Just do what the class forces you to do. > I would appear that Glib::ObjectBase defines reference(), so does that > mean that all derived objects should go through RefPtr? No, things that derive from Gtk::Object cannot use simple reference-counting. -- [EMAIL PROTECTED] www.murrayc.com www.openismus.com _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
