Tile **matrix;//do whatever you do with it...//---Clean it up---//delete stuff each pointer points tofor (int i = 0; i < NUM_OF_ITEMS_IN_MATRIX; i++) delete [] matrix[i]; //delete the array of Tile objects in memory// ^^ this is what was added//then delete the actual array of pointersdelete [] matrix;
since each of the elements of matrix is an array then delete [] is needed.