fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously (#20632)
* fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously * test: remote references should be able to be cleared for all cases
This commit is contained in:
parent
2abea22b4b
commit
ba8f80267c
5 changed files with 43 additions and 5 deletions
|
@ -127,6 +127,10 @@ class ObjectsRegistry {
|
|||
this.clear(webContents, contextId)
|
||||
}
|
||||
}
|
||||
// Note that the "render-view-deleted" event may not be emitted on time when
|
||||
// the renderer process get destroyed because of navigation, we rely on the
|
||||
// renderer process to send "ELECTRON_BROWSER_CONTEXT_RELEASE" message to
|
||||
// guard this situation.
|
||||
webContents.on('render-view-deleted' as any, listener)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue