Skip to content

Commit

Permalink
io.launcher: Fix two potential bugs.
Browse files Browse the repository at this point in the history
1) If first (pipe) succeeds but second one fails, first pipe leaks.
2) out>> dispose fails, then in>> dispose is never called and leaks.
  • Loading branch information
erg committed May 19, 2013
1 parent c64cb2c commit 7c1caac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions basis/io/launcher/launcher.factor
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c1caac

Please sign in to comment.