tutanota
tutanota copied to clipboard
[desktop/mac] make destroying ipc more robust with destroyed webcontents
sometimes, the window is gone before we get to destroy the bridge. This gives a TypeError: object has been destroyed. In other cases, we try to send messages to already destroyed webContents, giving TypeErrors because webContents.fromId returns undefined.
To prevent this
- we add a listener to the destroy event of the webContents
- don't use ids for referencing the webContents, instead pass the content itself around to be able to check isDestroyed()
fix https://github.com/tutao/tutanota/issues/4467