You are not logged in.
Pages: 1
I've noticed when running a TSynDaemon program with --console parameter on Linux that the method Stop is called twice when I press [Enter] to quit. This raised an AV Exception in method implementation as the following:
procedure TBareDaemon.Stop;
begin
fHttpServer.Free;
fServer.Free;
end;
and I had to rewrite it as follows:
procedure TBareDaemon.Stop;
begin
if fHttpServer <> nil then
begin
fHttpServer.Free;
fHttpServer := nil
end;
if fServer <> nil then
begin
fServer.Free;
fServer := nil
end;
end;
I got this AV Exception also in sample "37 - FishShop Service", for the same reason.
Offline
It is clearly documented as such:
/// inherited class should override this abstract method with proper process
// - should do nothing if the daemon was already stopped
procedure Stop; virtual; abstract;
Offline
Pages: 1