Commit 991f4060 authored by Gabriel Schulhof's avatar Gabriel Schulhof
Browse files

n-api: back up env before async work finalize

We must back up the value of `_env` before calling the async work
complete callback, because the complete callback may delete the
instance in which `_env` is stored by calling `napi_delete_async_work`,
and because we need to use it after the complete callback has
completed.

Fixes: https://github.com/nodejs/node/issues/20966
PR-URL: https://github.com/nodejs/node/pull/21129


Reviewed-By: default avatarAnatoli Papirovski <apapirovski@mac.com>
Reviewed-By: default avatarRefael Ackermann <refack@gmail.com>
Reviewed-By: default avatarMichael Dawson <michael_dawson@ca.ibm.com>
parent 1aa582a9
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment