Untested
procedure TStartUp.DrwMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
If Assigned(fMyObject) Then fMyObject.CheckSomething(X, Y); // Or If fMyObject<>Nil Then....
end;
that would solve this certain problem, but i realy would like to understand what and why this happens.
Also untested but have you considered using the FreeAndNil(fMyObject); in the actual onclose event instead of the query ? (perhaps not possible for your situation (I can not tell from the snippet posted).
* I mean that usually you set the variable CanClose in the oncloseqeury to force the close (based on any condition that your app want to use).
i do not have anything in the OnClose Handler. I use the CloseQuery handler to prevent the user from exit without saveing.
Does OnClose get called after the CloseQuery ?
Interesting location to call terminate ... *
i think the Application.Terminate should be executed at the very end, isn't that the Case here ?
as far as i know, OnClose itself calls Application.Terminate because its my MainForm right ? so it would not even be needed.
But with or without the Application.Terminate, i still get this Access violation.
if i do
then i run into a "endless Loop" and the Application wont terminate