diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 18:46:35 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 18:46:35 +0000 |
commit | 5b1a0da177656de7be3f554d99805b61d18d4af8 (patch) | |
tree | 0db4fbd0ba4070df6724916f9fa828124fb09117 /chrome | |
parent | 6408eba7f314035688d4222360d0b0346f0ed2f7 (diff) | |
download | chromium_src-5b1a0da177656de7be3f554d99805b61d18d4af8.zip chromium_src-5b1a0da177656de7be3f554d99805b61d18d4af8.tar.gz chromium_src-5b1a0da177656de7be3f554d99805b61d18d4af8.tar.bz2 |
B=1302955 R=sky attempt to bandaid situation where tab_data_ and child list can get out of sync
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/tabs/tab_strip.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/tabs/tab_strip.cc b/chrome/browser/tabs/tab_strip.cc index c498f0b..327c3e5 100644 --- a/chrome/browser/tabs/tab_strip.cc +++ b/chrome/browser/tabs/tab_strip.cc @@ -533,6 +533,17 @@ void TabStrip::DestroyDraggedSourceTab(Tab* tab) { // We could be running an animation that references this Tab. if (active_animation_.get()) active_animation_->Stop(); + // Make sure we leave the tab_data_ vector in a consistent state, otherwise + // we'll be pointing to tabs that have been deleted and removed from the + // child view list. + std::vector<TabData>::iterator it = tab_data_.begin(); + for (; it != tab_data_.end(); ++it) { + if (it->tab == tab) { + NOTREACHED() << "Leaving in an inconsistent state!"; + tab_data_.erase(it); + break; + } + } tab->GetParent()->RemoveChildView(tab); delete tab; } |