Skip to content

Commit

Permalink
Avoid dangling pointers in LabelButton test.
Browse files Browse the repository at this point in the history
To avoid dangling pointers, this CL does the following:
- It calls ExtractAsDangling on raw pointers to widget before calling
  Widget::CloseNow(), since CloseNow() will trigger destruction.
- It replaces pointers to views with getters that obtain the views
  by searching for them by ID in the ContentsView of the widget.

All the other changes in the file are due to replacing members by
getters, mostly button_ -> button().

Bug: 1469136
Change-Id: Ibb4b954737e5ec413127d8d6fbe086644fb8a397
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4938582
Reviewed-by: Elly FJ <ellyjones@chromium.org>
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1210228}
  • Loading branch information
Jan Keitel authored and Chromium LUCI CQ committed Oct 16, 2023
1 parent ad91a50 commit 35c1d2e
Showing 1 changed file with 307 additions and 289 deletions.

0 comments on commit 35c1d2e

Please sign in to comment.