fix double message when tool terminated

This commit is contained in:
Basile Burg 2019-01-18 06:43:32 +01:00
parent de824376ff
commit b76cc3ce0e
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ type
TToolItem = class(TCollectionItem) TToolItem = class(TCollectionItem)
private private
fToolItems: TToolItems; fToolItems: TToolItems;
fTerminatedFlag: boolean;
fNextToolAlias: string; fNextToolAlias: string;
fProcess: TDexedProcess; fProcess: TDexedProcess;
fExecutable: TFilename; fExecutable: TFilename;
@ -190,6 +191,7 @@ const
confSpec = 'Are you sure you want to execute the "%s" tool ?'; confSpec = 'Are you sure you want to execute the "%s" tool ?';
begin begin
u_processes.killProcess(fProcess); u_processes.killProcess(fProcess);
fTerminatedFlag := false;
if fMsgs = nil then if fMsgs = nil then
fMsgs := getMessageDisplay; fMsgs := getMessageDisplay;
@ -263,6 +265,9 @@ begin
end; end;
if (not fProcess.Running) then if (not fProcess.Running) then
begin begin
if fTerminatedFlag then
exit;
fTerminatedFlag := true;
if fProcess.ExitStatus <> 0 then if fProcess.ExitStatus <> 0 then
begin begin
fMsgs.message(format('error: the tool (%s) has returned the status %s', fMsgs.message(format('error: the tool (%s) has returned the status %s',