From 1fc5b9429da5eca3e14f141d21bb6c0d20456642 Mon Sep 17 00:00:00 2001 From: Rtangyu Date: Wed, 14 Sep 2022 10:41:43 +0800 Subject: [PATCH] JS and C++ precision mix stacks add worker threads (worker destruction) Save the worker thread to the main VM, and delete it from the main VM when the worker is destructed issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5QXKN Signed-off-by: Rtangyu --- worker/worker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worker/worker.cpp b/worker/worker.cpp index 7265104..a04408d 100644 --- a/worker/worker.cpp +++ b/worker/worker.cpp @@ -1139,6 +1139,9 @@ void Worker::CallHostFunction(size_t argc, const napi_value* argv, const char* m void Worker::ReleaseWorkerThreadContent() { + auto hostEngine = reinterpret_cast(hostEnv_); + auto workerEngine = reinterpret_cast(workerEnv_); + hostEngine->DeleteWorker(hostEngine, workerEngine); // 1. remove worker instance count { std::lock_guard lock(g_workersMutex); -- Gitee