[fpc-pascal] Halting program without mem leaks

Marco van de Voort marcov at stack.nl
Fri Apr 10 12:42:10 CEST 2009

In our previous episode, leledumbo said:
> I need to make a program exited with an exit code other than 0, but without
> mem leaks. Currently, Halt seems to return control to calling program (or
> OS) without freeing allocated mem. Exit (called from main program) does
> freeing, but I can't return any value because main program is considered a
> procedure. So, what should I do?

Explain why terminating a process doesn't free memory. Are you using DOS
TSRs ?

More information about the fpc-pascal mailing list