summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-23 00:37:56 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-23 00:37:56 +0000
commit074c6fcfeb61f7d325eb7021f62738940d583c20 (patch)
tree32d6e9a3e8bc0ffd6150271f35a4fee8ae3c2078
parent6d566b3a675c27ce32ecf76ef66ffbf4646eb0fa (diff)
downloadchromium_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.cc5
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.