Fix unclosed pipes.

This fixes #274.
This commit is contained in:
Qi Xiao 2016-10-13 21:09:37 +08:00
parent 97e126b1dd
commit 84ce58494e
2 changed files with 4 additions and 0 deletions

View File

@ -370,6 +370,8 @@ func captureOutput(ec *EvalCtx, op Op) []Value {
ClosePorts(newEc.ports)
<-bytesCollected
pipeRead.Close()
close(ch)
<-chCollected

View File

@ -353,6 +353,8 @@ func evalAndCollect(t *testing.T, texts []string, chsize int) ([]Value, []byte,
pw.Close()
<-bytesDone
pr.Close()
return outs, outBytes, ret, ex
}