I know there are a lot of questions about delete and delete but I can't seem to get a straight answer to this.
I create a bunch of objects, lets call them Things:
Thing* thing1 = new Thing();
Thing* thing10 = new Thing();
I then create an array of pointers to these things:
Thing** myArray = new Thing*;
And then copy the pointers across:
myArray = thing1;
myArray = thing10;
Now, if I want to properly clean up "myArray" I assume I call:
But what does this destroy? Is it just the list of pointers or does it destroy all the objects in it too?
i.e. are all the thing1... thing10 pointers still valid after the delete call?
Easy answer is this:
Anything created with "x = new Thingy;" must be destroyed by "delete x";
Anything created with "x = new Thingy[y];" must be destroyed by "delete  x;"
There is no cascading or recursive delete.
In you example you must do both. Use a loop and "delete" each pointer by hand, then call "delete " on your array.
Of course, in C++ you should probably be using classes that encapsulate the memory management and do the deletion for you, like perhaps a vector of shared_ptr's.