Add IsEmpty helper and remove GetInstance public usage
This commit is contained in:
parent
da5d7d72b0
commit
e7b679ead6
4 changed files with 14 additions and 13 deletions
|
@ -43,11 +43,10 @@ void Browser::Quit() {
|
|||
if (!is_quiting_)
|
||||
return;
|
||||
|
||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||
if (window_list->empty())
|
||||
if (atom::WindowList::IsEmpty())
|
||||
NotifyAndShutdown();
|
||||
|
||||
window_list->CloseAllWindows();
|
||||
else
|
||||
atom::WindowList::CloseAllWindows();
|
||||
}
|
||||
|
||||
void Browser::Exit(mate::Arguments* args) {
|
||||
|
@ -65,8 +64,7 @@ void Browser::Exit(mate::Arguments* args) {
|
|||
is_exiting_ = true;
|
||||
|
||||
// Must destroy windows before quitting, otherwise bad things can happen.
|
||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||
if (window_list->empty()) {
|
||||
if (atom::WindowList::IsEmpty()) {
|
||||
Shutdown();
|
||||
} else {
|
||||
// Unlike Quit(), we do not ask to close window, but destroy the window
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue