LastCyborg
Programmer
I'm programming a MDI application, every ChildForm has code on an event just like this
onCreate()
{
Evaluator = new TEvaluator ();
}
onClose ()
{
delete Evaluator;
}
I have not problem with this, the problem consist that if I create 2 or more ChildrenForms, when I close the 2nd child I got an error EAcces memory.
I thought that every child is an object with his own memory space and if I close one of them the others objects (ChildWindows) don't should have problems.
so what I'm doing wrong.
Note: you can check this
copying this code to a MDIChild form
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Button1 = new TButton (this);
}
//--------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
delete Button1;
}
---LastCyborg---
onCreate()
{
Evaluator = new TEvaluator ();
}
onClose ()
{
delete Evaluator;
}
I have not problem with this, the problem consist that if I create 2 or more ChildrenForms, when I close the 2nd child I got an error EAcces memory.
I thought that every child is an object with his own memory space and if I close one of them the others objects (ChildWindows) don't should have problems.
so what I'm doing wrong.
Note: you can check this
copying this code to a MDIChild form
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Button1 = new TButton (this);
}
//--------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
delete Button1;
}
---LastCyborg---