child_process: `null` channel handle on close
authorFedor Indutny <fedor@indutny.com>
Thu, 24 Sep 2015 05:30:25 +0000 (01:30 -0400)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Fri, 25 Sep 2015 05:09:46 +0000 (22:09 -0700)
commit798dad24f408327625f47705c2bb00f9e71d08b4
tree95612356cf923f93f0ad0146c09b46c8b0f0236a
parent039f73fa83961cc17aa69fc5c1ac96b13d59b054
child_process: `null` channel handle on close

`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: https://github.com/nodejs/node/issues/2847
PR-URL: https://github.com/nodejs/node/pull/3041
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/internal/child_process.js
test/parallel/test-child-process-fork-regr-gh-2847.js [new file with mode: 0644]