Commit 975484c
committed
fix(tools): detach stdio when /dev/null open fails to avoid pipe-drainer leak
When os.OpenFile(os.DevNull) fails, the original code fell through with the bytes.Buffer pipes generateCommandLine attached, which makes exec.Cmd.Start spawn drainer goroutines that block on the GUI tool's stdout/stderr until it exits, defeating the Process.Release detach. Set Std{in,out,err} to nil in the fallback so the child inherits the parent's stdio with no extra goroutines.1 parent 0997cac commit 975484c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
| |||
0 commit comments