Do I have to delete this?

Hi there, in many of my classes I have a class member similar to this:
Gtk::CheckButton *id_checkbutton{};

I for one reason or another cannot put it in the Glib :: RefPtr<>, so my question is, do I have to manually delete that object or the gtk framework will do that? That checkbutton is added in the hierarchy of objects in the UI.

It depends. Do you call Gtk::make_managed() when constructing your Gtk::CheckButton instance? If so yes, the GTK framework will cleanup everything for you.

P.S. you can read more at Widgets

I’m using GladeBuilder->get_widget<> method. I’ve just read in the docs that gladebuilder does instantiate them as managed.
Thanks for your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.