-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[merge m68] MacViews: Harden MenuRunnerImplCocoa against an obscure A…
…ppKit lifetime issue If a toolkit-views MenuRunner is destroyed while a menu is open, the menu is closed. Often this occurs because the ui::MenuModel is also about to be destroyed. Normally this is fine. However, if an event has already been generated by the user to select a menu item, which hasn't yet been processed by the event queue, it's possible for a retained NSMenu to still have access to the ui:MenuModel raw pointer via its delegate (the Cocoa MenuController), causing an error. To fix, reset the MenuController when a MenuRunnerImplCocoa is released in this way. MenuRunnerImplCocoa has the only reference to MenuController so this will cause its -[MenuController dealloc] to clear itself as a delegate of the NSMenu it's still showing. Adds MenuRunnerImplCocoa.MenuRunnerImplCocoa which tickle the asan bots without the fix. TBR=tapted@chromium.org (cherry picked from commit 9cbd880) Bug: 823373 Change-Id: I9fc08108569a80f6b1c279f4eeef89f4a14d9dcf Reviewed-on: https://chromium-review.googlesource.com/1071275 Commit-Queue: Trent Apted <tapted@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#561736} Reviewed-on: https://chromium-review.googlesource.com/1075829 Reviewed-by: Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/branch-heads/3440@{#17} Cr-Branched-From: 010ddcf-refs/heads/master@{#561733}
- Loading branch information
Showing
4 changed files
with
107 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters