fix: BrowserView
crash when 'beforeunload' prevented (#37205)
fix: crash when beforeunload prevented
This commit is contained in:
parent
4d6f230d21
commit
8eee4f2df1
2 changed files with 4 additions and 2 deletions
|
@ -1222,7 +1222,9 @@ void WebContents::CloseContents(content::WebContents* source) {
|
|||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnCloseContents();
|
||||
|
||||
Destroy();
|
||||
// If there are observers, OnCloseContents will call Destroy()
|
||||
if (observers_.empty())
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void WebContents::ActivateContents(content::WebContents* source) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue