From 5b1a0da177656de7be3f554d99805b61d18d4af8 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Wed, 6 Aug 2008 18:46:35 +0000 Subject: 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 --- chrome/browser/tabs/tab_strip.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/browser') 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::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; } -- cgit v1.1