Original Post
a rather silly question:
struct foo {
list l;
};
foo *ptr = new foo();
should I ptr->l.clear(); before deleting ptr? or may I take for granted that ptr->l will be automatically deallocated at ptr deletion?
I made a test and memory gets deallocated without leaks, but Im not sure it will work like this everywhere..
struct foo {
list
};
foo *ptr = new foo();
should I ptr->l.clear(); before deleting ptr? or may I take for granted that ptr->l will be automatically deallocated at ptr deletion?
I made a test and memory gets deallocated without leaks, but Im not sure it will work like this everywhere..