Commit 798dad2
child_process:
`HandleWrap::OnClose` destroys the underlying C++ object and null's the
internal field pointer to it. Therefore there should be no references to
the wrapping JavaScript object.
`null` the process' `_channel` field right after closing it, to ensure
no crashes will happen.
Fix: #2847
PR-URL: #3041
Reviewed-By: Trevor Norris <trev.norris@gmail.com>null channel handle on close1 parent 039f73f commit 798dad2Copy full SHA for 798dad2
File tree
Expand file treeCollapse file tree
2 files changed
+41
-0
lines changedOpen diff view settings
Filter options
- lib/internal
- test/parallel
Expand file treeCollapse file tree
2 files changed
+41
-0
lines changedOpen diff view settings
Collapse file
lib/internal/child_process.js
Copy file name to clipboardExpand all lines: lib/internal/child_process.js+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
449 | 449 | |
450 | 450 | |
451 | 451 | |
| 452 | + |
452 | 453 | |
453 | 454 | |
454 | 455 | |
|
Collapse file
test/parallel/test-child-process-fork-regr-gh-2847.js
Copy file name to clipboard+40Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
0 commit comments