When using Glib::RefPtr<> and when Pointer?



Hello,

I'm a little confused about the Glib::RefPtr<> usage in gtkmm.

For some returns are used smart pointers and for some normal pointers.
e.g.:

Gtk::ComboBox:
Glib::RefPtr<TreeModel> 	get_model ()

but

Gtk::Bin:
Widget* 	get_child ()

So why is a smart pointer used for get_model(), but not for
get_child(). Is there a reason behind? Could someone please explain
this?

There are a lot more examples in Gtkmm like this.

regards
Andreas


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