[fpc-pascal] Freeing memory with exceptions

Sven Barth pascaldragon at googlemail.com
Wed May 24 17:11:12 CEST 2023


Hairy Pixels via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Mi., 24. Mai 2023, 14:10:

> You must have $H+ on and those are AnsiStrings? Why is there exception
> handling involved with AnsiString? I guess it needs this just in case an
> exception is thrown somewhere in the call stack?


Because Ansi- and UnicodeString are managed types. *All* managed types
managed string types, interfaces, Variants, managed records) must be
finalized correctly even if an exception occurs.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20230524/fe132d02/attachment-0001.htm>


More information about the fpc-pascal mailing list