Browse Source

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>
v6.x
Daniel Bevenius 8 years ago
committed by Myles Borins
parent
commit
c0e47e4f22
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      doc/api/addons.md

2
doc/api/addons.md

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

Loading…
Cancel
Save