delete[] ???

2004-06-03 12:04:10 PM
I have a form which has two types of TPanels on it. One is a Array of
TPanels one a lone TPanel.
I am trying to delete as follows
for(int x=0;x<this->ComponentCount;x++)
delete this->Components[x--];//side effect -- on x to account for
//why error??
delete[] pnlComponent;
I know the TPanel Array is deleted but I thought once I was done deleting
each TPanel of the Array I had to also delete the pointer to the Array as
well. Am I mistaken about this? That last line does toss an error.