summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_strip_controller.mm
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 00:29:04 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 00:29:04 +0000
commitb1a26cc8d92111b85944d01626dacab269011669 (patch)
treec382b7658c9e76ec98ea78e85814da0f1f68cdc3 /chrome/browser/cocoa/tab_strip_controller.mm
parent20ede07176ece47e95efa8f355ee68a61166b68c (diff)
downloadchromium_src-b1a26cc8d92111b85944d01626dacab269011669.zip
chromium_src-b1a26cc8d92111b85944d01626dacab269011669.tar.gz
chromium_src-b1a26cc8d92111b85944d01626dacab269011669.tar.bz2
Mac: Fix crash while dragging a tab alone in a window.
Specifically, the crash could be repro'ed as follows (it also occurred under other circumstances as well): Have a window with one or more tabs in it. Create a new window with a single tab. Drag the tab in the new window, and while dragging right-click (and release). This patch also prevents right-clicks while dragging from stopping the drag. BUG=23591 TEST=See above. Review URL: http://codereview.chromium.org/242139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.mm')
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index 411c04a..2f10f27 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -631,6 +631,12 @@ static const float kIndentLeavingSpaceForControls = 64.0;
NSView* tab = [self viewAtIndex:index];
[tab removeFromSuperview];
+ // Clear the tab controller's target.
+ // TODO(viettrungluu): [crbug.com/23829] Find a better way to handle the tab
+ // controller's target.
+ TabController* tabController = [tabArray_ objectAtIndex:index];
+ [tabController setTarget:nil];
+
if ([hoveredTab_ isEqual:tab]) {
hoveredTab_ = nil;
}