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

Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
This commit is contained in:
Cheng Zhao
2020-03-05 13:07:17 +09:00
committed by GitHub
parent 5736df41c8
commit 2543517443

View File

@@ -511,9 +511,6 @@ void AtomBrowserMainParts::PostMainMessageLoopRun() {
ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
#endif
node_debugger_->Stop();
js_env_->OnMessageLoopDestroying();
#if defined(OS_MACOSX)
FreeAppDelegate();
#endif
@@ -530,6 +527,11 @@ void AtomBrowserMainParts::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();
}