io.launcher: Fix two potential bugs.
1) If first (pipe) succeeds but second one fails, first pipe leaks. 2) out>> dispose fails, then in>> dispose is never called and leaks.db4
parent
c64cb2c886
commit
7c1caacc35
|
@ -233,15 +233,15 @@ PRIVATE>
|
|||
: <process-stream*> ( desc encoding -- stream process )
|
||||
[
|
||||
[
|
||||
(pipe) (pipe) {
|
||||
[ [ |dispose drop ] bi@ ]
|
||||
(pipe) |dispose
|
||||
(pipe) |dispose {
|
||||
[
|
||||
rot >process
|
||||
[ swap in>> or ] change-stdin
|
||||
[ swap out>> or ] change-stdout
|
||||
run-detached
|
||||
]
|
||||
[ [ out>> dispose ] [ in>> dispose ] bi* ]
|
||||
[ [ out>> &dispose drop ] [ in>> &dispose drop ] bi* ]
|
||||
[ [ in>> <input-port> ] [ out>> <output-port> ] bi* ]
|
||||
} 2cleave
|
||||
] dip <encoder-duplex> swap
|
||||
|
|
Loading…
Reference in New Issue