From 09d017733d2a068bcc7e9b8f0740b4dad7c7d9eb Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 10 Apr 2019 07:21:10 +0200 Subject: [PATCH] Remove ensureNoPipeIfWait, possible source of wrong report like #459 https://github.com/Basile-z/dexed/issues/459 --- src/u_ceproject.pas | 1 - src/u_common.pas | 12 ------------ src/u_main.pas | 2 +- src/u_tools.pas | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/u_ceproject.pas b/src/u_ceproject.pas index 78930aae..342e3e70 100644 --- a/src/u_ceproject.pas +++ b/src/u_ceproject.pas @@ -811,7 +811,6 @@ begin prc.CurrentDirectory := fSymStringExpander.expand(prc.CurrentDirectory) else prc.CurrentDirectory:= chd; - ensureNoPipeIfWait(prc); prc.Execute; while prc.Running do if poUsePipes in prc.Options then diff --git a/src/u_common.pas b/src/u_common.pas index 3dd6d9a3..3e51eab5 100644 --- a/src/u_common.pas +++ b/src/u_common.pas @@ -250,11 +250,6 @@ type *) procedure killProcess(var process: TAsyncProcess); - (** - * Ensures that the i/o process pipes are not redirected if it waits on exit. - *) - procedure ensureNoPipeIfWait(process: TProcess); - (** * Returns true if ExeName is already running. *) @@ -1081,13 +1076,6 @@ begin process := nil; end; -procedure ensureNoPipeIfWait(process: TProcess); -begin - if not (poWaitonExit in process.Options) then - exit; - process.Options := process.Options - [poStderrToOutPut, poUsePipes]; -end; - function getLineEndingLength(const fname: string): byte; var value: char = #0; diff --git a/src/u_main.pas b/src/u_main.pas index db052e88..2c557891 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -3171,7 +3171,7 @@ begin fRunProc := TDexedProcess.Create(nil); if redirect then begin - fRunProc.Options := [poStderrToOutPut, poUsePipes]; + fRunProc.Options := [poStderrToOutPut, poUsePipes, poWaitOnExit]; fRunProc.ShowWindow := swoHIDE; fRunProc.OnReadData := @asyncprocOutput; fRunProc.OnTerminate:= @asyncprocTerminate; diff --git a/src/u_tools.pas b/src/u_tools.pas index eff36f6d..5038a196 100644 --- a/src/u_tools.pas +++ b/src/u_tools.pas @@ -250,7 +250,6 @@ begin fProcess.Parameters.Text := arg; end; end; - ensureNoPipeIfWait(fProcess); if fProcess.Executable.fileExists then begin