Y funciona bien? Veo demasiados casteos no seguros en ese codigo
No se puede resolver usando constraints como dije mas arriba?
la clase TObjectList de Generics.Collections lo hace de esa manera:
Código Delphi
[-]
TObjectList< T: class > = class(TList< T >)
protected
procedure Notify(const Value: T; Action: TCollectionNotification); override;
procedure TObjectList< T >.Notify(const Value: T; Action: TCollectionNotification);
begin
inherited;
if OwnsObjects and (Action = cnRemoved) then
Value.DisposeOf;
end;