Skip to content

Commit

Permalink
backport env backup fix
Browse files Browse the repository at this point in the history
This backports 1a5a19d6d475578eec355a8b3079b4a96fc77489.
  • Loading branch information
Gabriel Schulhof committed Jul 10, 2018
1 parent c61dab0 commit b946ba1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ class Reference : private Finalizer {
// Check before calling the finalize callback, because the callback might
// delete it.
bool delete_self = reference->_delete_self;
napi_env env = reference->_env;

if (reference->_finalize_callback != nullptr) {
NAPI_CALL_INTO_MODULE_THROW(reference->_env,
NAPI_CALL_INTO_MODULE_THROW(env,
reference->_finalize_callback(
reference->_env,
reference->_finalize_data,
Expand Down

0 comments on commit b946ba1

Please sign in to comment.