From 32fad92be8c7838e0547d165dc079dcaa8d23e57 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 25 Jan 2016 16:43:45 +0100 Subject: [PATCH] small fix --- src/unix/CCUnix.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/CCUnix.ml b/src/unix/CCUnix.ml index 2d0af1e7..09ee3022 100644 --- a/src/unix/CCUnix.ml +++ b/src/unix/CCUnix.ml @@ -196,11 +196,12 @@ type process_full = < let with_process_full ?env cmd ~f = let env = match env with None -> Unix.environment () | Some e -> e in let oc, ic, err = Unix.open_process_full cmd env in + let close = lazy (Unix.close_process_full (oc,ic,err)) in let p = object method stdin = ic method stdout = oc method stderr = err - method close = Unix.close_process_full (oc,ic,err) + method close = Lazy.force close end in finally_ f p ~h:(fun () -> p#close)