是否在处置父 V8Runtime 时处置 V8ScriptEngine 实例?

Are V8ScriptEngine instances disposed when the parent V8Runtime is disposed?

是否在释放父 V8Runtime 时释放 V8ScriptEngine 实例?

图书馆的文档对此并不清楚。我已经实现了部分 CommonJS 环境,但我想确保使用 require() 创建的 V8ScriptEngine 实例最终被释放。

我认为你的问题的答案是否定的;处置运行时 而不是 会自动处置其子引擎。每个引擎在单独处理之前都保持功能。

更多信息here

The managed engine and runtime are proxies for reference-counted unmanaged objects. Disposing or finalizing a proxy decrements its target's reference count, and the target is destroyed when its reference count reaches zero. Furthermore, the unmanaged engine holds an additional reference to its parent runtime, so the runtime will be kept alive as long as the engine remains active, regardless of whether a runtime proxy exists on the managed side.