doc: fix order of AtExit callbacks in addons.md

The sanity_check AtExit callback needs to come last to verify that the
other callbacks have been completed. This was not noticed before as this
code was not been executed.

PR-URL: https://github.com/nodejs/node/pull/14048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Daniel Bevenius 2017-07-03 07:56:43 +02:00
parent 06ed0e8187
commit 02371c7a8c

View File

@ -1109,10 +1109,10 @@ static void sanity_check(void*) {
}
void init(Local<Object> exports) {
AtExit(sanity_check);
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb1, exports->GetIsolate());
AtExit(sanity_check);
}
NODE_MODULE(addon, init)