win: Delay quitting until next tick of message loop

This fixes app.quit() not working when it is called before the message
loop starts to run.
This commit is contained in:
Cheng Zhao 2015-08-27 11:42:06 +08:00
parent 9cdefb6069
commit ab859067aa

View file

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