| Index: chrome/browser/ui/cocoa/extensions/browser_action_button.mm
|
| diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
|
| index f92dfd72ec4926aa0e09e82d24d32e21aa65b1d2..393c33b663d7593421abfe1766d1c31d3af955c1 100644
|
| --- a/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
|
| +++ b/chrome/browser/ui/cocoa/extensions/browser_action_button.mm
|
| @@ -411,6 +411,9 @@ void ToolbarActionViewDelegateBridge::DoShowContextMenu() {
|
| // We only need to do this because in Cocoa's memory management, removing the
|
| // button from the toolbar doesn't synchronously dealloc it.
|
| viewControllerDelegate_.reset();
|
| + // Also reset the context menu, since it has a dependency on the backing
|
| + // controller (which owns its model).
|
| + contextMenuController_.reset();
|
| }
|
|
|
| - (BOOL)isAnimating {
|
| @@ -465,6 +468,9 @@ void ToolbarActionViewDelegateBridge::DoShowContextMenu() {
|
| if (testContextMenu_)
|
| return testContextMenu_;
|
|
|
| + // Make sure we delete any references to an old menu.
|
| + contextMenuController_.reset();
|
| +
|
| ui::MenuModel* contextMenu = viewController_->GetContextMenu();
|
| if (!contextMenu)
|
| return nil;
|
|
|