Commit 69593286 authored by jif's avatar jif Committed by Commit bot

Fix crash occurring during infobar dismissal at BVC deletion.

Calling the InfoBarContainerIOS destructor leads to the removal of infobars via
|InfoBarContainerIOS::PlatformSpecificRemoveInfoBar|, which leads to the BVC
wanting to change the InfoBarContainerIOS's height (in |infoBarContainerStateChanged|)
This leads to a crash because the InfoBarContainerIOS is in the process of
being deleted.

This CL makes the flow abort early.

BUG=448093

Review URL: https://codereview.chromium.org/1038903003

Cr-Commit-Position: refs/heads/master@{#322432}
parent ba307d98
......@@ -22,6 +22,7 @@ InfoBarContainerIOS::InfoBarContainerIOS(
}
InfoBarContainerIOS::~InfoBarContainerIOS() {
delegate_ = nullptr;
RemoveAllInfoBarsForDestruction();
}
......@@ -44,7 +45,7 @@ void InfoBarContainerIOS::PlatformSpecificRemoveInfoBar(
// Otherwise, the infobar is being replaced by another one. Do not call the
// delegate in this case, as the delegate will be updated when the new infobar
// is added.
if (infobar->total_height() == 0)
if (infobar->total_height() == 0 && delegate_)
delegate_->InfoBarContainerStateChanged(false);
// TODO(rohitrao, jif): [Merge 239355] Upstream InfoBarContainer deletes the
......
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