I have written as Delphi application that uses TApdComPort, TTimer, and TTcpClient.
My error control is via raising exceptions and catching them in a single place.
This application has started to hang on close. When running under the debugger you can also not stop it (CTL F2).
The application cannot be stopped even when running from the exe by Task Manager and so the PC needs to be rebooted to try again.
Can anyone give me some code that I can add to the Form OnClose, OnDestroy etc that will clean things up.
I understand that I will need to supply more details but am unsure of how much code to supply.
procedure TFR_Indicator_Main.FormCreate(Sender: TObject);
Application.OnException := HandleException; // Trap any Application Errors
procedure TFR_Indicator_Main.HandleException(Sender: TObject; E: Exception);
UpdateResponseDisplay('Error : ' + E.Message ,clRed);
FR_Indicator_Main.PA_Status.Color := clRed;
procedure TFR_Indicator_Main.BT_CloseClick(Sender: TObject);
procedure TFR_Indicator_Main.FormDestroy(Sender: TObject);