Throw error when BrowserWindow is created before app is ready

This commit is contained in:
Cheng Zhao 2014-10-30 21:32:35 +08:00
parent 35e5c2172f
commit 25f69df341
5 changed files with 20 additions and 5 deletions

View file

@ -13,7 +13,8 @@
namespace atom {
Browser::Browser()
: is_quiting_(false) {
: is_quiting_(false),
is_ready_(false) {
WindowList::AddObserver(this);
}
@ -93,6 +94,7 @@ void Browser::WillFinishLaunching() {
}
void Browser::DidFinishLaunching() {
is_ready_ = true;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
}