mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: don't destroy BrowserView webContents when owning BrowserWindow hasn't been closed (#42353)
* fix: moves bv webContents close to closed event * chore: adds unit tests * chore: test that bv webContents are destroyed when parent bw closed
This commit is contained in:
@@ -77,7 +77,7 @@ BrowserWindow.prototype._init = function (this: BWT) {
|
||||
|
||||
this._browserViews = [];
|
||||
|
||||
this.on('close', () => {
|
||||
this.on('closed', () => {
|
||||
this._browserViews.forEach(b => b.webContents?.close({ waitForBeforeUnload: true }));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user