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)
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to