diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2023-03-13 08:58:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 12:58:17 +0000 |
commit | 224cff7a2f1de9cc821c34ccac63cc9e4ef17531 (patch) | |
tree | fc3a8b28fc139899543724391b752e1bd5ed10a2 /core/runtime.rs | |
parent | e712fbfe4a56cf0d8e39354afbb8204e83d147f3 (diff) |
Revert "feat(core): prevent isolate drop for CLI main worker (#18059)" (#18157)
Fixes https://github.com/denoland/deno/issues/18120
https://github.com/denoland/deno/issues/18137
https://github.com/denoland/fresh/issues/1073
This reverts commit 0cce9c2bcc9667935a571d30847e66ef5d01a196.
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index 75bdb4519..c3768d5fa 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -92,9 +92,6 @@ pub struct JsRuntime { event_loop_middlewares: Vec<Box<OpEventLoopFn>>, // Marks if this is considered the top-level runtime. Used only be inspector. is_main: bool, - // Marks if it's OK to leak the current isolate. Use only by the - // CLI main worker. - leak_isolate: bool, } pub(crate) struct DynImportModEvaluate { @@ -299,10 +296,6 @@ pub struct RuntimeOptions { /// Describe if this is the main runtime instance, used by debuggers in some /// situation - like disconnecting when program finishes running. pub is_main: bool, - - /// Whether it is OK to leak the V8 isolate. Only to be used by CLI - /// top-level runtime. - pub leak_isolate: bool, } #[derive(Copy, Clone, PartialEq, Eq)] @@ -336,16 +329,6 @@ impl Drop for JsRuntime { if let Some(v8_isolate) = self.v8_isolate.as_mut() { Self::drop_state_and_module_map(v8_isolate); } - if self.leak_isolate { - if let Some(v8_isolate) = self.v8_isolate.take() { - // Clear the GothamState. This allows final env cleanup hooks to run. - // Note: that OpState is cloned for every OpCtx, so we can't just drop - // one reference to it. - let rc_state = self.op_state(); - rc_state.borrow_mut().clear_state(); - std::mem::forget(v8_isolate); - } - } } } @@ -683,7 +666,6 @@ impl JsRuntime { state: state_rc, module_map: Some(module_map_rc), is_main: options.is_main, - leak_isolate: options.leak_isolate, }; // Init resources and ops before extensions to make sure they are |