Am 08.03.2018 09:44 schrieb "Ryan Joseph" <r...@thealchemistguild.com>:

2) We need to remember to call Free() at the end of the function and take
precaution to not exit early and leak memory (maybe even using a goto to
break out of nested loops or nested functions, who knows).


You are supposed to use try...finally for this. The finally-block is always
executed when the try-block is left no matter if it's by reaching the end,
calling exit or by an exception.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to