Skip to content

Conversation

gabrielschulhof
Copy link
Contributor

Calling into the engine from a weak callback is unsafe, however, the
engine offers a way to attach a second-pass weak callback which gets
called when it is safe to call into JavaScript. This moves the point
at which the N-API finalize callback gets called to this latter point.

Fixes: #25927
PR-URL: #25992

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. node-api Issues and PRs related to the Node-API. v10.x labels Feb 12, 2019
@gabrielschulhof gabrielschulhof force-pushed the 25927-finalize-during-second-pass-callback-v10.x branch from 4b7d59c to b79bdb8 Compare February 12, 2019 19:36
@mhdawson
Copy link
Member

Looks like this needs a rebase

Calling into the engine from a weak callback is unsafe, however, the
engine offers a way to attach a second-pass weak callback which gets
called when it is safe to call into JavaScript. This moves the point
at which the N-API finalize callback gets called to this latter point.

Fixes: nodejs#25927
PR-URL: nodejs#25992
Backport-PR-URL: nodejs#26058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@gabrielschulhof gabrielschulhof force-pushed the 25927-finalize-during-second-pass-callback-v10.x branch from b79bdb8 to e66b09c Compare March 4, 2019 18:33
@gabrielschulhof
Copy link
Contributor Author

@mhdawson rebased.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gabrielschulhof
Copy link
Contributor Author

New CI: https://ci.nodejs.org/job/node-test-pull-request/21343/

BethGriggs pushed a commit that referenced this pull request Mar 12, 2019
Calling into the engine from a weak callback is unsafe, however, the
engine offers a way to attach a second-pass weak callback which gets
called when it is safe to call into JavaScript. This moves the point
at which the N-API finalize callback gets called to this latter point.

Fixes: #25927
PR-URL: #25992
Backport-PR-URL: #26058
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@BethGriggs
Copy link
Member

Landed in b5588da

@BethGriggs BethGriggs closed this Mar 12, 2019
@gabrielschulhof gabrielschulhof deleted the 25927-finalize-during-second-pass-callback-v10.x branch June 14, 2019 23:51
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++. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants