summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 23:39:19 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 23:39:19 +0000
commit62e3b90b17781357161dd1e37d8dab99cb17b5c0 (patch)
tree81815b31a80ecb19d0102f656fc0d74bfcb09490 /chrome/browser/views/tabs
parent2bc2de68e5961170980496f79d4b89a9956b3b49 (diff)
downloadchromium_src-62e3b90b17781357161dd1e37d8dab99cb17b5c0.zip
chromium_src-62e3b90b17781357161dd1e37d8dab99cb17b5c0.tar.gz
chromium_src-62e3b90b17781357161dd1e37d8dab99cb17b5c0.tar.bz2
Fix crash in delayed tab resizing. If the Resize Relayout code is called after the last tab has been closed but before the window is destroyed (this whole process is very async) there are zero tabs in the layout and as a result GetTabAt(0) will crash.
http://crbug.com/14603 TEST=none Review URL: http://codereview.chromium.org/150064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19557 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index dea00aa..089925e 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -1191,6 +1191,12 @@ void TabStrip::GetDesiredTabWidths(int tab_count,
}
void TabStrip::ResizeLayoutTabs() {
+ // We've been called back after the TabStrip has been emptied out (probably
+ // just prior to the window being destroyed). We need to do nothing here or
+ // else GetTabAt below will crash.
+ if (GetTabCount() == 0)
+ return;
+
resize_layout_factory_.RevokeAll();
// It is critically important that this is unhooked here, otherwise we will