|
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TPanel *m_Pan;
TLabel *m_Name;
m_Pan = new TPanel(Application);
m_Pan->Parent = Form1;
m_Pan->Left = random(300);
m_Pan->Top = random(300);
m_Pan->Visible = true;
m_Name = new TLabel(Application);
m_Name->Parent = m_Pan;
m_Name->Caption = random(10000);
m_Name->Visible = true;
}
이처럼 버튼 클릭했을때 패널에 라벨을 넣는 것을 만들었을때...
이 생성된 객체들은 따로 delete해줄 필요가 없는건가요??
즉, m_Pan = new TPanel(Application); <-- 이렇게 new로 만든넘의 constructor에 Application이 들어가는
넘이랑 m_Pan = new TPanel(NULL); 해줄 경우의 차이점이 궁금합니다.
:)
|