Files
HDCApi/_custom/EMPolar/winSvc/mainSvcStop.inc
2026-03-03 16:18:27 +01:00

19 lines
632 B
PHP

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