Hello.
I do not know if it helps but fpGUI uses for Form.onClose => TCloseAction as parameter =>
(caNone, caHide, caFree)
Example how to close a form and free it =>
procedure TMyForm.AfterCreate;
begin
....
OnClose := @onCloseMyForm;
...
end;
procedure TMyForm.onCloseMyForm(Sender: TObject; var CloseAct : TCloseAction);
begin
CloseAct := caFree;
end;
Fre;D