Commit 4decd920 authored by sky@chromium.org's avatar sky@chromium.org

Attempt at fixing tab dragging crash. I believe the crash is happening

because there is an existing TabDragController when a new one is
created. Right after we create the new TabDragController it replaces
the old, but if we create the new one before the old is destroyed it
means the old is still set as a delegate on the TabContents so that
when the new restores the delegates it restores the old
TabDragController, which has now been deleted.

BUG=107172
TEST=none
R=ben@chromium.org


Review URL: http://codereview.chromium.org/8915026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114653 0039d316-1c4b-4281-b951-d872f2087c98
parent b1417ab9
......@@ -343,6 +343,10 @@ void BaseTabStrip::MaybeStartDrag(
TabStripSelectionModel selection_model;
if (!original_selection.IsSelected(model_index))
selection_model.Copy(original_selection);
// Delete the existing DragController before creating a new one. We do this as
// creating the DragController remembers the TabContents delegates and we need
// to make sure the existing DragController isn't still a delegate.
drag_controller_.reset();
drag_controller_.reset(TabDragController::Create(
this, tab, tabs, gfx::Point(x, y), tab->GetMirroredXInView(event.x()),
selection_model));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment