summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 03:00:13 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 03:00:13 +0000
commitcc066577cbc3ac106f126c3825567e254e134b53 (patch)
treeb91897b829b2658e0922c66e453c7ea321528324
parent0ed1a8d125df2e6eb3458a81577809d6101a5575 (diff)
downloadchromium_src-cc066577cbc3ac106f126c3825567e254e134b53.zip
chromium_src-cc066577cbc3ac106f126c3825567e254e134b53.tar.gz
chromium_src-cc066577cbc3ac106f126c3825567e254e134b53.tar.bz2
Merge 72590 - [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 TBR=estade@chromium.org Review URL: http://codereview.chromium.org/6528040 git-svn-id: svn://svn.chromium.org/chrome/branches/648/src@75062 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 a835996..d68365c 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -398,7 +398,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 e372278..880bea8 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.