   if Assigned(gorDownPDFThr) then
    begin
{$IFDEF DEBUG}
     WriteLn ('Ukoncuji sluzbu GOR downloadPDF...');
{$ENDIF}
     datMod.LogInfo (Quick.Logger.etInfo, 'Ukoncuji sluzbu GOR downloadPDF...');
     try
       gorDownPDFThr.ThreadTerminate;
       FreeAndNil(gorDownPDFThr);
      except on E:Exception do
// add event in eventlog with reason why the service couldn't stop
       LogMessage('Cannot stop service: ' + E.Message, EVENTLOG_ERROR_TYPE, 0, 1);
     end;
     datMod.LogInfo (Quick.Logger.etInfo, '  OK');
{$IFDEF DEBUG}
     WriteLn ('  OK');
{$ENDIF}
    end;
