Re: [fpc-pascal] Freeing memory with exceptions

2023-05-30 Thread Hairy Pixels via fpc-pascal
> On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal > wrote: > > > In C you need to do something like this: > > Function MyFunction(out theresult : TResultType) : Integer; > > begin > Allocate A > ... > error condition 1: >Free A, exit (1); > ... > Allocate B >

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-30 Thread Michael Van Canneyt via fpc-pascal
On Tue, 30 May 2023, Hairy Pixels via fpc-pascal wrote: On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal wrote: In C you need to do something like this: Function MyFunction(out theresult : TResultType) : Integer; begin Allocate A ... error condition 1: Free A,

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-30 Thread Steve Litt via fpc-pascal
Michael Van Canneyt via fpc-pascal said on Tue, 30 May 2023 16:55:16 +0200 (CEST) >On Tue, 30 May 2023, Hairy Pixels via fpc-pascal wrote: > >> >> >>> On May 25, 2023, at 1:10 PM, Michael Van Canneyt via fpc-pascal >>> wrote: >>> >>> >>> In C you need to do something like this: >>> >>>

Re: [fpc-pascal] Freeing memory with exceptions

2023-05-30 Thread Sven Barth via fpc-pascal
Steve Litt via fpc-pascal schrieb am Di., 30. Mai 2023, 21:57: > I don't know about other operating systems, but on Linux a crashed > program gives up all its memory, even leaked memory, upon termination, > so I'm not sure why this attention to memory leak on abnormal > termination is even