Commit 0ac25a7
authored
fix: reap child processes on session stop/kill to prevent zombies (#8)
captureOutput goroutine could exit via the done channel without calling
cmd.Wait(), leaving terminated child processes as zombies in the process
table. Moved cmd.Wait() and p.Close() into a defer so the child is
always reaped regardless of exit path.1 parent bbd4c20 commit 0ac25a7
1 file changed
+25
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
480 | 504 | | |
481 | 505 | | |
482 | 506 | | |
| |||
513 | 537 | | |
514 | 538 | | |
515 | 539 | | |
516 | | - | |
| 540 | + | |
517 | 541 | | |
518 | 542 | | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| |||
0 commit comments