| Index: chrome/browser/cocoa/tab_controller.mm
|
| diff --git a/chrome/browser/cocoa/tab_controller.mm b/chrome/browser/cocoa/tab_controller.mm
|
| index 94de7cfc1a72ee6f571fe8d58bdd72cd9d2ad280..0d05c5c0f0197ceb923de54878084d35c6616cb5 100644
|
| --- a/chrome/browser/cocoa/tab_controller.mm
|
| +++ b/chrome/browser/cocoa/tab_controller.mm
|
| @@ -47,6 +47,17 @@
|
| }
|
|
|
| - (void)dealloc {
|
| + // Since the tab can be closed from JavaScript it is possible for
|
| + // |contextMenu_| to remain visible after the tab has closed, or for
|
| + // |closeButton_| to be tracking the mouse. Make sure neither sends
|
| + // us an action after -dealloc.
|
| + [closeButton_ setTarget:nil];
|
| + [contextMenu_ setAutoenablesItems:NO];
|
| + for (NSMenuItem* item in [contextMenu_ itemArray]) {
|
| + [item setTarget:nil];
|
| + [item setEnabled:NO];
|
| + }
|
| +
|
| [[NSNotificationCenter defaultCenter] removeObserver:self];
|
| [super dealloc];
|
| }
|
|
|