Problem freeing memory of a form

Hello,
When I create a form from within a script, I get the following error when trying to do a MyForm.free ? “System Error. Code:5 Access is denied” ?
When I put timers,buttons, panels and labels, I have no problem freeing.
However, when I put a listbox, I get the same error trying to free it?
When I have System.ReportMemoryLeaksOnShutdown := true; I get memory leak errors for the form, listbox and other items from the form?
What am I doing wrong? How can I fix it ?
Thanks,
Ken Davis

var MyForm:TForm;
begin
try
MyForm := TForm.Create(nil);
MyForm…
finally
MyForm.free;
end;
end.

Very sorry, I was able to fix the problem.

Thanks,
Ken Davis