Hi, this is just a dumb question about memory management in GTKmm. I read the section regarding this topic in the GTKmm book online, but one thing still nags me.
The book states that I can let the container in which an object resides in to destroy that object using the manage() and add() methods. However, what if I do the following:
(Assume that table and aButton are members of the below class)
Code:
someClass::someClass() {
// a Gtk::Table
table = manage(new Gtk::Table(1, 1, false));
// some button
aButton = manage(new Gtk::Button("Test"));
// attach the button to the table
table->attach(*aButton, 0, 1, 0, 1);
add(*table);
show_all_children();
}
In this example, will the
aButton widget be automatically destroyed by
table when the class is destroyed? In other words, if I pack a widget created with manage() into a container using say attach() instead of add(), would that object be destroyed by the parent container?
Thanks in advance!