Quote:
Originally posted by dug
what if you've got a situation like:
>> CSessionImage **image_vector;
>> image_vector = new CSessionImage *[num_ds];
so, a dynamically sized array of pointers to objects [in this case a CSessionImage object]....
calling:
>> delete [] image_vector;
in the local deconstructor, does not slip into the CSessionImage deconstructor as expected. and so does not free the memory allocated for the CSessionImage.
any ideas?
OK, you have an array of pointers. If you want to have deletion of the array delete the objects themselves, you need to explicitly delete the objects. For example, this line: