Fix object destroyed error
This commit is contained in:
parent
8cb281c74e
commit
ab52530c10
1 changed files with 7 additions and 2 deletions
|
@ -694,8 +694,13 @@ async function safeLoadURL(window: BrowserWindow, url: string): Promise<void> {
|
|||
}
|
||||
throw error;
|
||||
} finally {
|
||||
window.webContents.removeListener('did-stop-loading', onDestroyed);
|
||||
window.webContents.removeListener('destroyed', onDestroyed);
|
||||
try {
|
||||
window.webContents.removeListener('did-stop-loading', onDestroyed);
|
||||
window.webContents.removeListener('destroyed', onDestroyed);
|
||||
} catch {
|
||||
// We already logged or thrown an error - don't bother with handling the
|
||||
// error here.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue