fix: destroy node platform after destroying wrappers (#22527)

This commit is contained in:
Cheng Zhao 2020-03-05 09:59:59 +09:00 committed by GitHub
parent bff8d65200
commit 1d1d04f4a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -486,9 +486,6 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
#endif
node_debugger_->Stop();
js_env_->OnMessageLoopDestroying();
#if defined(OS_MACOSX)
FreeAppDelegate();
#endif
@ -505,6 +502,11 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
++iter;
}
// Destroy node platform after all destructors_ are executed, as they may
// invoke Node/V8 APIs inside them.
node_debugger_->Stop();
js_env_->OnMessageLoopDestroying();
fake_browser_process_->PostMainMessageLoopRun();
}