Commit 9bd776f4 authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[Toolbar container] Destroy potential observers before the observer list

This CL makes sure ToolbarIconContainerView destroys its children before
its own observer list (this is needed so that childred that observe
ToolbarIconContainerView can remove themselves from the observer list).

Bug: 1013418
Change-Id: Ica6b8c89b9d0683933c84d65faf6f9a4641e55b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860339Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705628}
parent bf7924a3
...@@ -29,7 +29,11 @@ ToolbarIconContainerView::ToolbarIconContainerView(bool uses_highlight) ...@@ -29,7 +29,11 @@ ToolbarIconContainerView::ToolbarIconContainerView(bool uses_highlight)
gfx::Insets(0, GetLayoutConstant(TOOLBAR_ELEMENT_PADDING))); gfx::Insets(0, GetLayoutConstant(TOOLBAR_ELEMENT_PADDING)));
} }
ToolbarIconContainerView::~ToolbarIconContainerView() = default; ToolbarIconContainerView::~ToolbarIconContainerView() {
// As childred might be Observers of |this|, we need to destroy them before
// destroying |observers_|.
RemoveAllChildViews(true);
}
void ToolbarIconContainerView::UpdateAllIcons() {} void ToolbarIconContainerView::UpdateAllIcons() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment