Can calling AForm.Free be dangerous

Giganews Newsgroups
Subject:Can calling AForm.Free be dangerous
Posted by: John-Arne GangĂ„s
Date:Thu, 28 Jan 2010

Hi.

Consider this code

procedure SomeMethod;
var
  myForm: TMyForm;
begin
  myForm:= TMyForm.create(aowner);
  myForm.ShowModal;
  myForm.Free;
end;

My colleague says he has heard that it can be dangerous to free'e a form. You should instead call release.
Is it true that this can be dangerous. Why?

thanks

Replies