How to correctly write Try..Finally..Except statements?
问题 Take the following code as a sample: procedure TForm1.Button1Click(Sender: TObject); var Obj: TSomeObject; begin Screen.Cursor:= crHourGlass; Obj:= TSomeObject.Create; try // do something finally Obj.Free; end; Screen.Cursor:= crDefault; end; if there was an error happening in the // do something section, the TSomeObject that was created I assume will not be freed and the Screen.Cursor will still be stuck as an Hour Glass, because the code was broke before getting to those lines? Now unless I