[fpc-pascal] Double finalize

Hairy Pixels genericptr at gmail.com
Thu Dec 21 00:11:14 CET 2023



> On Dec 21, 2023, at 1:53 AM, Michael Van Canneyt via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> If you look at the generated code, you see that there is an implicit try/finally block
> and the  finally block does a finalize.

Maybe I misunderstood but I thought they were supposed to be balanced with init calls. Is it the design of the compiler to allow multiple finalize calls and have the user keep track of it the underlying structure is really finalized or not? If you were doing things like deleting memory in the finalizer you would have a double free happen here.

Regards,
Ryan Joseph



More information about the fpc-pascal mailing list