From aee47539540852a82018c94505493dd9162eaa75 Mon Sep 17 00:00:00 2001 From: Artem Udovichenko Date: Wed, 3 Aug 2022 12:11:29 +0300 Subject: [PATCH] Create EcmaHandleScope in EcmnaVM::HandleEnqueReferences Signed-off-by: Artem Udovichenko --- runtime/ecma_vm.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/ecma_vm.cpp b/runtime/ecma_vm.cpp index fe51b3544..a71fd7a85 100644 --- a/runtime/ecma_vm.cpp +++ b/runtime/ecma_vm.cpp @@ -827,6 +827,11 @@ void EcmaVM::ProcessPrograms(const WeakRootVisitor &v0) void EcmaVM::HandleEnqueueReferences() { + // Handle references only in JS thread + if (Thread::GetCurrent() != thread_) { + return; + } + [[maybe_unused]] EcmaHandleScope scope(thread_); for (JSFinalizationRegistry *registry : finalization_registries_) { JSHandle handle(thread_, registry); JSFinalizationRegistry::CallCleanupCallback(thread_, handle); -- Gitee