diff --git a/rtl/objpas/classes/compon.inc b/rtl/objpas/classes/compon.inc index 7a9918df5e..c6e83dbf88 100644 --- a/rtl/objpas/classes/compon.inc +++ b/rtl/objpas/classes/compon.inc @@ -603,6 +603,8 @@ Procedure TComponent.InsertComponent(AComponent: TComponent); begin AComponent.ValidateContainer(Self); ValidateRename(AComponent,'',AComponent.FName); + If AComponent.FOwner<>Nil then + AComponent.FOwner.Remove(AComponent); Insert(AComponent); AComponent.SetReference(True); If csDesigning in FComponentState then