Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
don't call method of destroyed webContents
Browse files Browse the repository at this point in the history
  • Loading branch information
icecream17 committed Oct 21, 2021
1 parent 2053290 commit c9ecdfe
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ const averageTracker = new AverageTracker({limit: operationCountLimit});
const childPidsById = new Map();

const destroyRenderer = () => {
if (!managerWebContents.isDestroyed()) {
managerWebContents.removeListener('crashed', destroyRenderer);
managerWebContents.removeListener('destroyed', destroyRenderer);
}
const win = remote.BrowserWindow.fromWebContents(remote.getCurrentWebContents());
if (win && !win.isDestroyed()) {
win.destroy();
Expand Down

0 comments on commit c9ecdfe

Please sign in to comment.