Fix crash when calling app.quit() before app is ready
This commit is contained in:
parent
230f2760e7
commit
ca876e424b
1 changed files with 8 additions and 2 deletions
|
@ -53,8 +53,14 @@ void Browser::Shutdown() {
|
||||||
is_quiting_ = true;
|
is_quiting_ = true;
|
||||||
|
|
||||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
|
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
|
||||||
base::MessageLoop::current()->PostTask(
|
|
||||||
FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
|
if (base::MessageLoop::current()) {
|
||||||
|
base::MessageLoop::current()->PostTask(
|
||||||
|
FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
|
||||||
|
} else {
|
||||||
|
// There is no message loop available so we are in early stage.
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Browser::GetVersion() const {
|
std::string Browser::GetVersion() const {
|
||||||
|
|
Loading…
Reference in a new issue