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 MylesBorins committed Sep 19, 2017
1 parent 9d84641 commit c0e47e4
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 @@ -1090,10 +1090,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 c0e47e4

Please sign in to comment.