I have ;
class object {
// any private datas token in heap area
public :
~object () ;
};
<
You put in the destructor whatever your class needs to free its members.
As for the vector, it contains pointers, not object instances. As such, calling erase()
will only remove pointers from the vector, but will not free the objects that the pointers are pointing at. You have to free the objects separately, eg:
std::vector