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:
parent
39c984e23a
commit
5fb117a7d7
2 changed files with 54 additions and 5 deletions
|
@ -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 }));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue