Index: chrome/browser/chromeos/login/base_login_display_host.cc |
diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc |
index ce8a9f7a89edb62716234d2bee970215ee53ff87..90f5a59a07e64925149c1abcb115075239cdcdb7 100644 |
--- a/chrome/browser/chromeos/login/base_login_display_host.cc |
+++ b/chrome/browser/chromeos/login/base_login_display_host.cc |
@@ -90,9 +90,19 @@ BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) |
NotificationService::AllSources()); |
DCHECK(default_host_ == NULL); |
default_host_ = this; |
+ |
+ // Add a reference count so the message loop won't exit when other |
+ // message loop clients (e.g. menus) do. |
+ g_browser_process->AddRefModule(); |
} |
BaseLoginDisplayHost::~BaseLoginDisplayHost() { |
+ // A browser should already exist when destructor is called since |
+ // deletion is scheduled with MessageLoop::DeleteSoon() from |
+ // OnSessionStart(), so the browser will already have incremented |
+ // the reference count. |
+ g_browser_process->ReleaseModule(); |
+ |
default_host_ = NULL; |
} |