tutanota icon indicating copy to clipboard operation
tutanota copied to clipboard

[desktop/mac] make destroying ipc more robust with destroyed webcontents

Open ganthern opened this issue 1 year ago • 0 comments

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

ganthern avatar Aug 05 '22 14:08 ganthern