From: Paul Betts Date: Wed, 21 Oct 2015 00:27:28 +0000 (-0700) Subject: Since setting up process_singleton is now conditional, its cleanup / unlock must... X-Git-Tag: v0.34.1~9^2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e5094fff3eb06b9feae8ac5e6bf22b7cffe90b87;p=electron.git Since setting up process_singleton is now conditional, its cleanup / unlock must be too --- diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index 4308395e..483e58a9 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -117,7 +117,11 @@ void Browser::WillFinishLaunching() { void Browser::DidFinishLaunching() { is_ready_ = true; - process_singleton_->Unlock(); + + if (process_notify_callback_set_) { + process_singleton_->Unlock(); + } + FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching()); } @@ -144,7 +148,10 @@ void Browser::NotifyAndShutdown() { return; } - process_singleton_->Cleanup(); + if (process_notify_callback_set_) { + process_singleton_->Cleanup(); + } + Shutdown(); } @@ -167,6 +174,10 @@ void Browser::InitializeSingleInstance() { base::Bind(&Browser::OnProcessSingletonNotification, no_refcount_this))); process_notify_result_ = process_singleton_->NotifyOtherProcessOrCreate(); + + if (is_ready_) { + process_singleton_->Unlock(); + } } ProcessSingleton::NotifyResult Browser::GetSingleInstanceResult() {