From 8c7f6cc2700f3ef645556b04a896741323ab11c3 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 26 Aug 2015 10:13:36 +0200 Subject: [PATCH] fix, prevented a custom tool to freeze when two incompatible options are activated --- src/ce_common.pas | 5 +---- src/ce_nativeproject.pas | 1 - src/ce_tools.pas | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index 24d1f295..668377c1 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -196,11 +196,10 @@ type procedure killProcess(var aProcess: TCheckedAsyncProcess); (** - * Ensures that the in/out process pipes are not redirected, that it has a console, if it waits on exit. + * Ensures that the i/o process pipes are not redirected if it waits on exit. *) procedure ensureNoPipeIfWait(aProcess: TProcess); - (** * Returns true if Exename is running under Windows or Linux *) @@ -853,9 +852,7 @@ procedure ensureNoPipeIfWait(aProcess: TProcess); begin if not (poWaitonExit in aProcess.Options) then exit; - // aProcess.Options := aProcess.Options - [poStderrToOutPut, poUsePipes]; - aProcess.Options := aProcess.Options + [poNewConsole]; end; function getLineEndingLength(const aFilename: string): byte; diff --git a/src/ce_nativeproject.pas b/src/ce_nativeproject.pas index 0ee0010e..a22042c6 100644 --- a/src/ce_nativeproject.pas +++ b/src/ce_nativeproject.pas @@ -621,7 +621,6 @@ begin ensureNoPipeIfWait(process); process.Execute; while process.Running do - if not (poWaitOnExit in process.Options) then if poUsePipes in process.Options then runProcOutput(process); finally diff --git a/src/ce_tools.pas b/src/ce_tools.pas index fa427151..23eb8274 100644 --- a/src/ce_tools.pas +++ b/src/ce_tools.pas @@ -177,6 +177,7 @@ begin end; for i:= 0 to fParameters.Count-1 do fProcess.Parameters.AddText(symbolExpander.get(fParameters.Strings[i])); + ensureNoPipeIfWait(fProcess); fProcess.Execute; end;