mirror of https://gitlab.com/basile.b/dexed.git
fix, prevented a custom tool to freeze
when two incompatible options are activated
This commit is contained in:
parent
b429c8a46d
commit
8c7f6cc270
|
@ -196,11 +196,10 @@ type
|
||||||
procedure killProcess(var aProcess: TCheckedAsyncProcess);
|
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);
|
procedure ensureNoPipeIfWait(aProcess: TProcess);
|
||||||
|
|
||||||
|
|
||||||
(**
|
(**
|
||||||
* Returns true if Exename is running under Windows or Linux
|
* Returns true if Exename is running under Windows or Linux
|
||||||
*)
|
*)
|
||||||
|
@ -853,9 +852,7 @@ procedure ensureNoPipeIfWait(aProcess: TProcess);
|
||||||
begin
|
begin
|
||||||
if not (poWaitonExit in aProcess.Options) then
|
if not (poWaitonExit in aProcess.Options) then
|
||||||
exit;
|
exit;
|
||||||
//
|
|
||||||
aProcess.Options := aProcess.Options - [poStderrToOutPut, poUsePipes];
|
aProcess.Options := aProcess.Options - [poStderrToOutPut, poUsePipes];
|
||||||
aProcess.Options := aProcess.Options + [poNewConsole];
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function getLineEndingLength(const aFilename: string): byte;
|
function getLineEndingLength(const aFilename: string): byte;
|
||||||
|
|
|
@ -621,7 +621,6 @@ begin
|
||||||
ensureNoPipeIfWait(process);
|
ensureNoPipeIfWait(process);
|
||||||
process.Execute;
|
process.Execute;
|
||||||
while process.Running do
|
while process.Running do
|
||||||
if not (poWaitOnExit in process.Options) then
|
|
||||||
if poUsePipes in process.Options then
|
if poUsePipes in process.Options then
|
||||||
runProcOutput(process);
|
runProcOutput(process);
|
||||||
finally
|
finally
|
||||||
|
|
|
@ -177,6 +177,7 @@ begin
|
||||||
end;
|
end;
|
||||||
for i:= 0 to fParameters.Count-1 do
|
for i:= 0 to fParameters.Count-1 do
|
||||||
fProcess.Parameters.AddText(symbolExpander.get(fParameters.Strings[i]));
|
fProcess.Parameters.AddText(symbolExpander.get(fParameters.Strings[i]));
|
||||||
|
ensureNoPipeIfWait(fProcess);
|
||||||
fProcess.Execute;
|
fProcess.Execute;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue