[fpc-pascal] Double finalize
Hairy Pixels
genericptr at gmail.com
Thu Dec 21 14:35:05 CET 2023
> On Dec 21, 2023, at 12:06 PM, Hairy Pixels <genericptr at gmail.com> wrote:
>
> Here's another example of this. If I use an array Finalize is called 4 times but Initialize is never called, unless you assign a record to the array and then it's called once.
>
> This makes even less sense. What's the idea behind this behavior? I would expect the calls to balanced as this feature is intended for reference counting I thought.
I had some time to think about this more and I think it does make sense actually. Initializing each element wouldn't make sense because there was no assignment made but if an assignment were made it would need to finalize but during compile time there's no way to know which elements were assigned to.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list