diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-04-16 13:18:45 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-04-24 21:38:38 +0200 |
commit | 324154631097e5fd3e4043c2c4c86a73d153500c (patch) | |
tree | 399445a13349bf78e3fc8ae23354e120d9e8d5ea /src/api/hooks.cc | |
parent | 51079db826601425f4364a010a6468d734519d95 (diff) | |
download | android-node-v8-324154631097e5fd3e4043c2c4c86a73d153500c.tar.gz android-node-v8-324154631097e5fd3e4043c2c4c86a73d153500c.tar.bz2 android-node-v8-324154631097e5fd3e4043c2c4c86a73d153500c.zip |
src: add `Environment` overload of `EmitAsyncDestroy`
This can be necessary for being able to call the function when no
JS Context is on the stack, e.g. during GC.
Refs: https://github.com/nodejs/node/issues/27218
PR-URL: https://github.com/nodejs/node/pull/27255
Fixes: https://github.com/nodejs/node/issues/27218
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src/api/hooks.cc')
-rw-r--r-- | src/api/hooks.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/hooks.cc b/src/api/hooks.cc index 3b1ee90a99..cec58cee00 100644 --- a/src/api/hooks.cc +++ b/src/api/hooks.cc @@ -130,8 +130,11 @@ async_context EmitAsyncInit(Isolate* isolate, } void EmitAsyncDestroy(Isolate* isolate, async_context asyncContext) { - AsyncWrap::EmitDestroy( - Environment::GetCurrent(isolate), asyncContext.async_id); + EmitAsyncDestroy(Environment::GetCurrent(isolate), asyncContext); +} + +void EmitAsyncDestroy(Environment* env, async_context asyncContext) { + AsyncWrap::EmitDestroy(env, asyncContext.async_id); } } // namespace node |