diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-23 00:37:56 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-23 00:37:56 +0000 |
commit | 074c6fcfeb61f7d325eb7021f62738940d583c20 (patch) | |
tree | 32d6e9a3e8bc0ffd6150271f35a4fee8ae3c2078 | |
parent | 6d566b3a675c27ce32ecf76ef66ffbf4646eb0fa (diff) | |
download | chromium_src-074c6fcfeb61f7d325eb7021f62738940d583c20.zip chromium_src-074c6fcfeb61f7d325eb7021f62738940d583c20.tar.gz chromium_src-074c6fcfeb61f7d325eb7021f62738940d583c20.tar.bz2 |
Fix crash due to NULL deref.
http://crbug.com/3183
Review URL: http://codereview.chromium.org/8069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3803 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index 4f20e57..c5bf55a 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -498,8 +498,11 @@ void DraggedTabController::Detach() { TabStripModel* attached_model = attached_tabstrip_->model(); int index = attached_model->GetIndexOfTabContents(dragged_contents_); if (index >= 0 && index < attached_model->count()) { + // Sometimes, DetachTabContentsAt has consequences that result in + // attached_tabstrip_ being set to NULL, so we need to save it first. + TabStrip* attached_tabstrip = attached_tabstrip_; attached_model->DetachTabContentsAt(index); - attached_tabstrip_->SchedulePaint(); + attached_tabstrip->SchedulePaint(); } // If we've removed the last Tab from the TabStrip, hide the frame now. |