]> khamidou — GitHub mirrors - electron.git/commitdiff
win: Delay quitting until next tick of message loop
authorCheng Zhao <zcbenz@gmail.com>
Thu, 27 Aug 2015 03:42:06 +0000 (11:42 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 27 Aug 2015 03:42:06 +0000 (11:42 +0800)
This fixes app.quit() not working when it is called before the message
loop starts to run.

atom/browser/browser.cc

index 1ca682de15bb3d2b7637b338bfb2e97fa7445afd..3419ecbe330d75886f183c930060ef6fa6fdc4d1 100644 (file)
@@ -45,7 +45,8 @@ void Browser::Shutdown() {
   FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
 
   is_quiting_ = true;
-  base::MessageLoop::current()->Quit();
+  base::MessageLoop::current()->PostTask(
+      FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
 }
 
 std::string Browser::GetVersion() const {