Skip to content

Commit

Permalink
doc: fix order of AtExit callbacks in addons.md
Browse files Browse the repository at this point in the history
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: #14048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
danbev authored and addaleax committed Aug 10, 2017
1 parent e07dfff commit 4e15a6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4e15a6b

Please sign in to comment.