Hi Team,
For years, up to and including D10.4.1, I have been using the following in my App, and it has been running without issue via RDP on a Customer's Win 2012 R2 Server..
{Main Form code}
procedure TMainForm.mnuRemovePartsClick(Sender: TObject);
begin
//
TRemovePartsForm.Create(Self).ShowModal;
//
end;
{code}
and in RemovePartsForm I have this at Close..
{RemovePartsForm code}
procedure TRemovePartsForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
dmS.DBC1.CloseDataSets;
Action := caFree;
end;
{code}
Closing RemovePartsForm takes me back to the Main Form.
Rebuilding the App in D10.4.2, and running it on the Server, when the Close button is clicked and the form closes the App crashes to the OS effectively at the Action := caFree! 😞 It does not happen on my Dev Win 10 PC.
I have a work around..
{Main Form code}
procedure TMainForm.mnuRemovePartsClick(Sender: TObject);
var
RemovePartsForm: TRemovePartsForm;
begin
//
RemovePartsForm := TRemovePartsForm.Create(Self);
//
try
//
RemovePartsForm.ShowModal;
//
finally
RemovePartsForm.Free;
end;
//
end;
{code}
and ....
{RemovePartsForm code}
procedure TRemovePartsForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
dmS.DBC1.CloseDataSets;
end;
{code}
And it all works as it used to.
Unless someone can enlighten me otherwise, I suspect an issue here..
Regards,
Ian