electron-userland / electron-spellchecker

Implement spellchecking, correctly
MIT License
238 stars 83 forks source link

Unsubscribing on unload event #90

Open Camyll opened 7 years ago

Camyll commented 7 years ago

I am currently using a 'beforeunload' event to track when I should unsubscribe from the spellchecker and the contextMenuListener. I am unsubscribing from these events because if I do not and then I resubscribe, it has led to crashes in the past.

The app occasionally receives beforeunload events that get cancelled, leaving me with no spellchecker or menu.

  1. Is there a better event to be unsubscribing on?
  2. In the latest version or future versions (I believe I'm on 1.6) will there be an automatic cleanup for these events?
  3. Has anyone else had trouble with this sort of issue? If it's a more widespread problem, I would love to contribute to a solution for all.
Anrock commented 6 years ago

How about 'unload' event? It's fired after beforeunload and is not cancelable.