mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: handle closing webContents in BrowserViews (#37420)
* fix: handle closing webContents in BrowserViews * test: add window.close() test
This commit is contained in:
@@ -1223,9 +1223,7 @@ void WebContents::CloseContents(content::WebContents* source) {
|
||||
for (ExtendedWebContentsObserver& observer : observers_)
|
||||
observer.OnCloseContents();
|
||||
|
||||
// If there are observers, OnCloseContents will call Destroy()
|
||||
if (observers_.empty())
|
||||
Destroy();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void WebContents::ActivateContents(content::WebContents* source) {
|
||||
|
||||
Reference in New Issue
Block a user