diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 9a15edbdfddbe..82713b7d15288 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -458,7 +458,8 @@ void ElectronBrowserMainParts::WillRunMainMessageLoop( std::unique_ptr& run_loop) { js_env_->OnMessageLoopCreated(); exit_code_ = content::RESULT_CODE_NORMAL_EXIT; - Browser::Get()->SetMainMessageLoopQuitClosure(run_loop->QuitClosure()); + Browser::Get()->SetMainMessageLoopQuitClosure( + run_loop->QuitWhenIdleClosure()); } void ElectronBrowserMainParts::PostCreateMainMessageLoop() {