Set Form.parent to nil on remove object

This commit is contained in:
juliocandrade@gmail.com 2022-12-02 16:56:36 -03:00
parent 574146d906
commit 9787e23c32

View File

@ -30,7 +30,10 @@ begin
for lIndex := Self.ControlCount - 1 downto 0 do
begin
if (Self.Controls[lIndex] is TForm) then
begin
(Self.Controls[lIndex] as TForm).Close;
(Self.Controls[lIndex] as TForm).parent := nil;
end;
end;
end;