J
john smith
Hi, when there is a vector<> of pointers to some objects, does calling
resize cause vector to call delete on each object, or is there a memory leak
problem?
for example:
struct base {//some vars; ~base();};
vector<base*> vb;
vb.push_back(new base);
vb.push_back(new base);
vb.push_back(new base);
vb.push_back(new base);
vb.resize(12); // cause memory leak here?
Thanks in advance.
S
resize cause vector to call delete on each object, or is there a memory leak
problem?
for example:
struct base {//some vars; ~base();};
vector<base*> vb;
vb.push_back(new base);
vb.push_back(new base);
vb.push_back(new base);
vb.push_back(new base);
vb.resize(12); // cause memory leak here?
Thanks in advance.
S