fix: don't destroy BrowserView webContents when owning BrowserWindow hasn't been closed (#42371)
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 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Anny Yang <anny@electronjs.org>
This commit is contained in:
parent
fb6b8e91db
commit
484cf26787
2 changed files with 54 additions and 5 deletions
|
@ -54,7 +54,7 @@ BrowserWindow.prototype._init = function (this: BWT) {
|
|||
|
||||
this._browserViews = [];
|
||||
|
||||
this.on('close', () => {
|
||||
this.on('closed', () => {
|
||||
this._browserViews.forEach(b => b.webContents?.close({ waitForBeforeUnload: true }));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue