Skip to content

[v6.x backport] src: add environment cleanup hooks#22633

Closed
gabrielschulhof wants to merge 2 commits into
nodejs:v6.x-stagingfrom
gabrielschulhof:backport-19377-to-v6.x
Closed

[v6.x backport] src: add environment cleanup hooks#22633
gabrielschulhof wants to merge 2 commits into
nodejs:v6.x-stagingfrom
gabrielschulhof:backport-19377-to-v6.x

Conversation

@gabrielschulhof

Copy link
Copy Markdown
Contributor

This adds pairs of methods to the Environment class and to public APIs
which can add and remove cleanup handlers.

Unlike AtExit, this API targets addon developers rather than
embedders, giving them (and Node’s internals) the ability to register
per-Environment cleanup work.

We may want to replace AtExit with this API at some point.

Many thanks for Stephen Belanger for reviewing the original version of
this commit in the Ayo.js project.

Refs: ayojs/ayo#82
PR-URL: #19377

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants