Fix possible use-after-free when menu is closed by its item.

Fix use-after-free which occured when a menu contained an item closing
it on a mouse press event. In such case MenuController object was freed
during a call of its OnMousePressed() but it continued to modify its
member variables.

Bug: 871205
Change-Id: Ic2a5dd3a745da6b0c1ef7a87f2cb498cc1a97234
Reviewed-by: Trent Apted <>
Commit-Queue: Trent Apted <>
Cr-Commit-Position: refs/heads/master@{#584706}
2 files changed