<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">fredvs via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> schrieb am Mo., 24. Feb. 2020, 02:10:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tomas Hajny-2 wrote<br>
> The difference between your version and the original one is that the <br>
> original finishes the program with some error code thus allowing some <br>
> error checking in case the program was called from some script, etc., <br>
> whereas your version finishes with a result of 0 even if the processing <br>
> encountered some errors.<br>
<br>
No, I dont think so, all error code are still there.<br>
Even more, if the user dont use a filename as parameter, help-messages are<br>
displayed.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You are wrong. Halt() sets the error code provided as parameter. Terminate by itself does not. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
And also I dont see what it could have to do with the memory leak.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Terminate leads to the destructor being called while Halt exists the program in a hard way. But as Tomas wrote, when a program terminates all memory is returned to the OS so that is not really a problem. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div>