Bonjour

Pouvez vous m'expliquer pourquoi m'a desallocation ne marche pas?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
       TPageControl* pClasseur;
        TTabSheet *pTabSheet[3];
        TStringGrid *pStringGrid[3];
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
//---------------------------------------------------------------------------
void __fastcall TForm1::fabClick(TObject *Sender)
{
  pClasseur = new TPageControl(Form1->Handle);
  for (int i=0; i<4; i++)
  {
        pTabSheet[i] = new TTabSheet(pClasseur->Handle);
        pTabSheet[i]->PageControl = pClasseur;
        pTabSheet[i]->Name = "blabla" + (AnsiString)i;
 
        pStringGrid[i] = new TStringGrid(pClasseur->Handle);
        pStringGrid[i]->RowCount = 10;
        pStringGrid[i]->ColCount = 10;
        pStringGrid[i]->Parent = pTabSheet[i];
        pStringGrid[i]->Align = alClient;
        pStringGrid[i]->Cells[1][1] = i;
  }
  pClasseur->TabWidth = ((Form1->Width)/(pClasseur->PageCount)) -4;
  pClasseur->Parent = Form1;
  pClasseur->TabPosition = tpBottom;
  pClasseur->Align = alClient;
}
//---------------------------------------------------------------------------
 
void __fastcall TForm1::Fermerlanomenclature1Click(TObject *Sender)
{
delete[] pStringGrid;
}
merci