fix: call node::Stop on exit (#25501)

* fix: call node::Stop on exit (#25430)

* Update node_main.cc
This commit is contained in:
Jeremy Rose
2020-09-16 19:32:11 -07:00
committed by GitHub
parent c58b1fe256
commit afe59c52a3
2 changed files with 2 additions and 1 deletions

View File

@@ -152,7 +152,7 @@ int NodeMain(int argc, char* argv[]) {
env->set_trace_sync_io(false);
exit_code = node::EmitExit(env);
env->set_can_call_into_js(false);
node::Stop(env);
node::RunAtExit(env);
v8::Isolate* isolate = env->isolate();

View File

@@ -553,6 +553,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
// invoke Node/V8 APIs inside them.
node_debugger_->Stop();
node_env_->env()->set_trace_sync_io(false);
node::Stop(node_env_->env());
node_env_.reset();
js_env_->OnMessageLoopDestroying();