<p>Am 13.10.2016 10:09 schrieb "Graeme Geldenhuys" <<a href="mailto:mailinglists@geldenhuys.co.uk">mailinglists@geldenhuys.co.uk</a>>:<br>
><br>
> On 2016-10-12 20:37, grouchysmurf wrote:<br>
> > Say, I have a code, where TH is a Class(TCustomApplication):<br>
> ><br>
> >   ph := TH.Create(Nil);<br>
> >   ph.Initialize;<br>
> >   ph.ProcessOptions;<br>
> >   ph.Run;<br>
> >   ph.Free;<br>
><br>
> I would also rewrite that with a try..finally as in:<br>
><br>
> ph := TH.Create(nil)<br>
> try<br>
>   ph.Initialize;<br>
>   ph.ProcessOptions;<br>
>   ph.Run;<br>
> finally<br>
>   ph.Free;<br>
> end;<br>
></p>
<p>That won't help with Halt() however as that will "jump" directly to the unit finalization, ignoring any and all exception handlers along the way.</p>
<p>Regards,<br>
Sven</p>