Originally Posted by
shrink_tubing
So what do I need to do - if anything - to guarantee the prevention of memory leaks here?
well, you could add this in the destructor:
Code:
for ( unsigned int i = 0; i < myArraySize, ++i ) {
delete myArray[ i ];
}
If u didnt knew the arrays size u could use sizeof():
Code:
for ( unsigned int i = 0; i < sizeof(myArray) / sizeof(char*), ++i )
note that this could cause a crash if the poiter is unitialized, so i realy recoment using a myArraySize variable to keep track of the number of objects alocated.
this should clear the array,
I hope it helped and i also hope i didnt screw up in the explanation :P