From 9787e23c32f07e98e0f90d7d326592eea2758193 Mon Sep 17 00:00:00 2001 From: "juliocandrade@gmail.com" Date: Fri, 2 Dec 2022 16:56:36 -0300 Subject: [PATCH] Set Form.parent to nil on remove object --- src/Router4D.Helper.pas | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Router4D.Helper.pas b/src/Router4D.Helper.pas index 11a96b7..1cb674a 100644 --- a/src/Router4D.Helper.pas +++ b/src/Router4D.Helper.pas @@ -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;