Form does not download from memory

3

Hello everyone, I need help. My form does not download from memory so I can not call it again. Here is the code below:

If formage=nil then
Begin

I create form and no onclose of form

Action:=cafree:
Formage:=nil

Does anyone have an idea ???

    
asked by anonymous 07.11.2017 / 01:18

1 answer

3

Remove the reported procedures from the procedure OnClose . And after the Form view (which logically occurred after creation) you apply the destruction:

formage := Tformage.Create(Application);
formage.ShowModal;
FreeAndNil(formage);

Notice that after the Display is called the method of deformation! This is the right way to control memory.Letting that Delphi is weak in this management. That is, within the form formage you should control the creation and destruction of your variables.

    
07.11.2017 / 14:59