clear the storage for the webContentsId when the render view is deleted

This commit is contained in:
bridiver 2016-08-15 21:52:16 -07:00
parent 420f756c47
commit 3b11bf5e41

View file

@ -27,8 +27,8 @@ class ObjectsRegistry {
if (!owner) {
owner = this.owners[webContentsId] = new Set()
// Clear the storage when webContents is reloaded/navigated.
webContents.once('render-view-deleted', (event, id) => {
this.clear(id)
webContents.once('render-view-deleted', () => {
this.clear(webContentsId)
})
}
if (!owner.has(id)) {