Skip to content

Commit

Permalink
fix(webkit): emit close on pages before clearing them (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Mar 13, 2020
1 parent 69be12a commit a96dec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webkit/wkBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ export class WKBrowser extends platform.EventEmitter implements Browser {
_onDisconnect() {
for (const wkPage of this._wkPages.values())
wkPage.dispose();
this._wkPages.clear();
for (const context of this._contexts.values())
context._browserClosed();
// Note: previous method uses pages to issue 'close' event on them, so we clear them after.
this._wkPages.clear();
this.emit(Events.Browser.Disconnected);
}

Expand Down

0 comments on commit a96dec5

Please sign in to comment.