#1 Re: mORMot 1 » Remote Logger sample project fails with AV on exit » 2019-10-20 00:11:08

By adding the following procedure in the client side, the AV on exit can be fixed.

procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  btnDisconnectClick(Self);
  CanClose := True;
end;

#2 Re: mORMot 1 » Remote Logger sample project fails with AV on exit » 2019-10-20 00:03:40

I met the same AV when trying to test the Remote Logging.

1. By using the RemoteLoggingTest to connect to the Remote Logger Server,  the reconnection will fail(Connect --> Disconnect --> Connect).
    It seems there is a bug in the following procedure:

procedure TSynLogFamily.EchoRemoteStop;
begin
  if fEchoRemoteClient=nil then    // testing fEchoRemoteClient
    exit;

   ........

  fEchoRemoteClient := nil;   // should be added
  fEchoRemoteEvent := nil;
end;

2. If the RemoteLoggingTest is still in Connection state, and try to close it, AV will ocure here:
 
procedure TSQLHttpClientGeneric.InternalURI(var Call: TSQLRestURIParams);
.....
begin
   ......
{$ifdef WITHLOG}
  with Call do     // AV occurs here, because procedure TSQLRestThread.Execute; calls InternalURI
    log.Log(sllClient,'% % status=% len=% state=%',
      [method,url,OutStatus,length(OutBody),OutInternalState],self);
{$endif}
end;

I don't know how to fix the second AV.  The program is in the process of closing, but the thread does not know that.

Board footer

Powered by FluxBB