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

* fix: call node::Stop on exit

* also call Stop in node_main

* oop, we were already calling set_can_call_into_js(false)??

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
trop[bot]
2020-09-16 09:25:51 +09:00
committed by GitHub
parent 51a35f8b4d
commit 80efb6d9da
2 changed files with 2 additions and 1 deletions

View File

@@ -284,7 +284,7 @@ int NodeMain(int argc, char* argv[]) {
node::ResetStdio();
env->set_can_call_into_js(false);
node::Stop(env);
env->stop_sub_worker_contexts();
env->RunCleanup();

View File

@@ -553,6 +553,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
node_debugger_->Stop();
node_env_->env()->set_trace_sync_io(false);
js_env_->OnMessageLoopDestroying();
node::Stop(node_env_->env());
node_env_.reset();
ElectronBrowserContext::browser_context_map().clear();