[fpc-pascal] Variants with classes and records

Marco van de Voort fpc at pascalprogramming.org
Thu Oct 6 17:11:58 CEST 2022


On 6-10-2022 14:16, Sven Barth via fpc-pascal wrote:
>
>     And that crashed also. I thought it would be ok to just hold the
>     reference but not claim ownership over it.
>
>
> Variants count as managed types and they can contain interface 
> references and strings. If you use a custom type you can do as you 
> please, but the internal types that can be assigned to a Variant *are* 
> managed accordingly (if the types themselves are managed).
>
(IIRC in case of native types there is another pointer in the variant 
which is an interface for something that manages the record.  But it has 
been a while)


More information about the fpc-pascal mailing list