From 3e5caf7e544ca006a7a63660c10e9fbffbded505 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 9 Dec 2015 18:19:51 -0800 Subject: [PATCH] Get exit code from within App::OnQuit --- atom/browser/api/atom_api_app.cc | 5 +++-- atom/browser/api/atom_api_app.h | 2 +- atom/browser/browser.cc | 3 +-- atom/browser/browser_observer.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 81ec3fefd510..256ecff53e10 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -180,8 +180,9 @@ void App::OnWindowAllClosed() { Emit("window-all-closed"); } -void App::OnQuit(const int code) { - Emit("quit", code); +void App::OnQuit() { + int exitCode = AtomBrowserMainParts::Get()->GetExitCode(); + Emit("quit", exitCode); if (process_singleton_.get()) { process_singleton_->Cleanup(); diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index f04a19e67cdf..a6f99d65e0af 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -42,7 +42,7 @@ class App : public AtomBrowserClient::Delegate, void OnBeforeQuit(bool* prevent_default) override; void OnWillQuit(bool* prevent_default) override; void OnWindowAllClosed() override; - void OnQuit(int code) override; + void OnQuit() override; void OnOpenFile(bool* prevent_default, const std::string& file_path) override; void OnOpenURL(const std::string& url) override; void OnActivate(bool has_visible_windows) override; diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index ee00efa07110..c77f359760c9 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -72,8 +72,7 @@ void Browser::Shutdown() { is_shutdown_ = true; is_quiting_ = true; - int exitCode = AtomBrowserMainParts::Get()->GetExitCode(); - FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit(exitCode)); + FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit()); if (base::MessageLoop::current()) { base::MessageLoop::current()->PostTask( diff --git a/atom/browser/browser_observer.h b/atom/browser/browser_observer.h index f3ae2e364de4..f6d76bc13fb3 100644 --- a/atom/browser/browser_observer.h +++ b/atom/browser/browser_observer.h @@ -24,7 +24,7 @@ class BrowserObserver { virtual void OnWindowAllClosed() {} // The browser is quitting. - virtual void OnQuit(const int code) {} + virtual void OnQuit() {} // The browser has opened a file by double clicking in Finder or dragging the // file to the Dock icon. (OS X only)