diff options
author | Gus Caplan <me@gus.host> | 2019-10-12 01:53:41 +0300 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2019-10-14 01:45:36 +0300 |
commit | 545f7282d126ee43cf9cfeb66c83d0cbd2c60614 (patch) | |
tree | 8cd69c849fb60a6a84af8894c16f02c7723a7dcf /src/node_task_queue.cc | |
parent | ea3d5ff785e5f7b327942f9b47b3bd958e77c51f (diff) |
src: implement v8 host weakref hooks
PR-URL: https://github.com/nodejs/node/pull/29874
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_task_queue.cc')
-rw-r--r-- | src/node_task_queue.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc index 3b00cbc600f..ef1aff6cd41 100644 --- a/src/node_task_queue.cc +++ b/src/node_task_queue.cc @@ -43,6 +43,8 @@ static void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) { // Should be in sync with runNextTicks in internal/process/task_queues.js bool RunNextTicksNative(Environment* env) { + OnScopeLeave weakref_cleanup([&]() { env->RunWeakRefCleanup(); }); + TickInfo* tick_info = env->tick_info(); if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn()) MicrotasksScope::PerformCheckpoint(env->isolate()); |