]> khamidou — GitHub mirrors - electron.git/commitdiff
Since setting up process_singleton is now conditional, its cleanup / unlock must...
authorPaul Betts <paul@paulbetts.org>
Wed, 21 Oct 2015 00:27:28 +0000 (17:27 -0700)
committerPaul Betts <paul@paulbetts.org>
Wed, 21 Oct 2015 00:27:28 +0000 (17:27 -0700)
atom/browser/browser.cc

index 4308395eb7140dbcfec6ff744d199c61e355bf36..483e58a988bea2ba2c8b0a39dd0f950e27e0859b 100644 (file)
@@ -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() {