Hi,
I came across the code of an old program of mine,
opening an ABOUT box, in a method of the main form:
procedure TMainForm.Info(Sender: TObject);
begin
// ( This form is NOT autocreated on program start )
AboutForm:= TAboutForm.Create( Self);
AboutForm.ShowModal;
end;
The var AboutForm is the global var being created automatically when doing "File/New Form"
( .. and renaming "Form1" to "AboutForm"... ) :
var
AboutForm: TAboutForm;
Now I am not sure it that's correct.
So I added some code:
AboutForm:= TAboutForm.Create( Self);
AboutForm.ShowModal;
AboutForm.Close;
AboutForm.Free;
Is this okay ? ... to free the object / memory ?
The HELP says "Close does not necessarily destroy the form."
I also found this code, in a tutorial:
So, what's the best way ? What happens behing the Scenes ?