Den 2017-07-06 kl. 11:06, skrev Kjell Ahlstedt:Den 2017-07-06 kl. 10:34, skrev Daniel Boles:I didn't think twice here. I should have. Glib::WeakRef can be useful, but std::weak_ptr can't. And Glib::WeakRef has been removed from glibmm-2.54 (gtkmm-4). std::weak_ptr informs you if a Glib::RefPtr still exists, but a TreeModel can outlive all RefPtrs, pointing to it. The ComboBox (actually the underlying GtkComboBox) keeps a reference to the GtkTreeModel. That reference will keep both the GtkTreeModel and the wrapping Gtk::TreeModel alive until the ComboBox dies. |