summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 01:58:29 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 01:58:29 +0000
commit16d90292907664f5ff43d9c91d95baf5f276958f (patch)
tree78d0ad7329cdc2f1dd17e35b51df9a75894c320d
parent5ccc1b12f102526923f31a8f05bd7aaa52e9f6de (diff)
downloadchromium_src-16d90292907664f5ff43d9c91d95baf5f276958f.zip
chromium_src-16d90292907664f5ff43d9c91d95baf5f276958f.tar.gz
chromium_src-16d90292907664f5ff43d9c91d95baf5f276958f.tar.bz2
[linux] Avoid crash when there's an X error during shutdown.
If X errors after the notification service has been destroyed (during browser shutdown), we'll deref NULL. Instead, we should just ignore the X error (aside from logging it to ERROR). BUG=70852 TEST=none Review URL: http://codereview.chromium.org/6379009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72590 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/browser_list.cc4
-rw-r--r--chrome/browser/ui/browser_list.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index 08a9d1d..8c7c172 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -393,7 +393,9 @@ void BrowserList::CloseAllBrowsersAndExit() {
void BrowserList::SessionEnding() {
// EndSession is invoked once per frame. Only do something the first time.
static bool already_ended = false;
- if (already_ended)
+ // We may get called in the middle of shutdown, e.g. http://crbug.com/70852
+ // In this case, do nothing.
+ if (already_ended || !NotificationService::current())
return;
already_ended = true;
diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h
index e489fea..3f0c5a8 100644
--- a/chrome/browser/ui/browser_list.h
+++ b/chrome/browser/ui/browser_list.h
@@ -110,7 +110,7 @@ class BrowserList {
// message.
static void CloseAllBrowsers();
- // Begins shutdown of the application when the session is ending.
+ // Begins shutdown of the application when the desktop session is ending.
static void SessionEnding();
// Returns true if there is at least one Browser with the specified profile.