async_wrap: call callback in destructor
authorTrevor Norris <trev.norris@gmail.com>
Tue, 20 Oct 2015 18:20:10 +0000 (12:20 -0600)
committerMyles Borins <mborins@us.ibm.com>
Tue, 19 Jan 2016 19:52:12 +0000 (11:52 -0800)
commit55336810ee6a0755b3cc994a19efdf48483cf6c8
treea23d12615f4c90b0a997353c0f391e823aea8682
parenta8b45e9e96269929a6e47b7b7e5ae17708e96bc6
async_wrap: call callback in destructor

Call a user's callback to notify that the handle has been destroyed.
Only pass the id of the AsyncWrap instance since the object no longer
exists.

The object that's being destructed should never be inspected within the
callback or any time afterward.

This commit make a breaking change. The init callback will now be passed
arguments in the order of provider, id, parent.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/async-wrap-inl.h
src/async-wrap.cc
src/async-wrap.h
src/env.h
test/parallel/test-async-wrap-disabled-propagate-parent.js
test/parallel/test-async-wrap-propagate-parent.js