fix: reparenting UAF crash on macOS (#38603)
This commit is contained in:
parent
9a9d8ae5ea
commit
5ee890fb6f
3 changed files with 36 additions and 10 deletions
|
@ -4677,6 +4677,21 @@ describe('BrowserWindow module', () => {
|
|||
expect(w.getChildWindows().length).to.equal(0);
|
||||
});
|
||||
|
||||
it('can handle child window close and reparent multiple times', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
let c: BrowserWindow | null;
|
||||
|
||||
for (let i = 0; i < 5; i++) {
|
||||
c = new BrowserWindow({ show: false, parent: w });
|
||||
const closed = once(c, 'closed');
|
||||
c.close();
|
||||
await closed;
|
||||
}
|
||||
|
||||
await setTimeout();
|
||||
expect(w.getChildWindows().length).to.equal(0);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'darwin')('child window matches visibility when visibility changes', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
const c = new BrowserWindow({ show: false, parent: w });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue