I never noticed it in my program before, but for one of my TForm I have a destroy event, which frees an object, is called or fired more than once. I don’t understand why.
procedure THTrendFrm.FormDestroy(Sender: TObject);
begin
LogAlarm.Free; <---Invalid Pointer Operation exception is raised
end;
Thanks in advance,
Update: Here is the FastMM message window right after my program is shutdown.
TAlarmMsg is the class from which LogAlarm is created.


Thanks to David Heffernan and others. I found my problem and fixed it. The TForm in question was being created twice in my project file like so.
Application.CreateForm(HTrendFrm, HTrend);
That explains why destroy was called twice.
Once I removed the duplicate line, it is shutting down fine.